diff --git a/.githooks/pre-push b/.githooks/pre-push new file mode 100755 index 0000000000..a0d1bb2666 --- /dev/null +++ b/.githooks/pre-push @@ -0,0 +1,20 @@ +#!/bin/bash -e + +# Prevents pushing any code to the server that does not comply with klint or detekt +# It ignores any unchecked files. + +# Ignore any unchecked file +echo "Stashing changes before doing checks" +git stash push -q -u --keep-index + +# Pop the stash once the scripts finishes, fails or gets cancelled +function pop_stash() { + echo "Checks completed, popping stash" + git stash pop -q +} + +trap "exit" INT TERM ERR +trap pop_stash EXIT + +# Do the actual check ups +./gradlew ktlintCheck detekt diff --git a/CHANGELOG.md b/CHANGELOG.md index 69e2e9c5f4..668aca626f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,83 @@ +## 1.1.0 (YYYY-MM-DD) + +### Breaking Changes +* None. + +### Enhancements +* Added support for `UUID` through a new property type: `RealmUUID`. +* Support for `Realm.writeCopyTo(configuration)`. +* [Sync] Add support for `User.delete()`, making it possible to delete user data on the server side (Issue [#491](https://github.com/realm/realm-kotlin/issues/491)). + +### Fixed +* `Realm.deleteRealm(config)` would throw an exception if the file didn't exist. + +### Compatibility +* This release is compatible with: + * Kotlin 1.6.10 and above. + * Coroutines 1.6.0-native-mt. Also compatible with Coroutines 1.6.0 but requires enabling of the new memory model and disabling of freezing, see https://github.com/realm/realm-kotlin#kotlin-memory-model-and-coroutine-compatibility for details on that. + * AtomicFu 0.17.0. +* Minimum Gradle version: 6.1.1. +* Minimum Android Gradle Plugin version: 4.0.0. +* Minimum Android SDK: 16. + +### Internal +* None. + + +## 1.0.2 (2022-08-05) + +### Breaking Changes +* None. + +### Enhancements +* None. + +### Fixed +* Missing proguard configuration for `CoreErrorUtils`. (Issue [#942](https://github.com/realm/realm-kotlin/issues/942)) +* [Sync] Embedded Objects could not be added to the schema for `SyncConfiguration`s. (Issue [#945](https://github.com/realm/realm-kotlin/issues/945)). + +### Compatibility +* This release is compatible with: + * Kotlin 1.6.10 and above. + * Coroutines 1.6.0-native-mt. Also compatible with Coroutines 1.6.0 but requires enabling of the new memory model and disabling of freezing, see https://github.com/realm/realm-kotlin#kotlin-memory-model-and-coroutine-compatibility for details on that. + * AtomicFu 0.17.0. +* Minimum Gradle version: 6.1.1. +* Minimum Android Gradle Plugin version: 4.0.0. +* Minimum Android SDK: 16. + +### Internal +* None. + + +## 1.0.1 (2022-07-07) + +### Breaking Changes +* None. + +### Enhancements +* Added support for `ByteArray`. ([#584](https://github.com/realm/realm-kotlin/issues/584)) + +### Fixed +* Fixed JVM memory leak when passing string to C-API. (Issue [#890](https://github.com/realm/realm-kotlin/issues/890)) +* Fixed crash present on release-mode apps using Sync due to missing Proguard exception for `ResponseCallback`. +* The compiler plugin did not set the generic parameter correctly for an internal field inside model classes. This could result in other libraries that operated on the source code throwing an error of the type: `undeclared type variable: T`. (Issue [#901](https://github.com/realm/realm-kotlin/issues/901)) +* String read from a realm was mistakenly treated as zero-terminated, resulting in strings with `\0`-characters to be truncated when read. Inserting data worked correctly. (Issue [#911](https://github.com/realm/realm-kotlin/issues/911)) +* [Sync] Fix internal ordering of `EmailPasswordAuth.resetPassword(...)` arguments. (Issue [#885](https://github.com/realm/realm-kotlin/issues/885)) +* [Sync] Sync error events not requiring a Client Reset incorrectly assumed they had to include a path to a recovery Realm file. (Issue [#895](https://github.com/realm/realm-kotlin/issues/895)) + +### Compatibility +* This release is compatible with: + * Kotlin 1.6.10 and above. + * Coroutines 1.6.0-native-mt. Also compatible with Coroutines 1.6.0 but requires enabling of the new memory model and disabling of freezing, see https://github.com/realm/realm-kotlin#kotlin-memory-model-and-coroutine-compatibility for details on that. + * AtomicFu 0.17.0. +* Minimum Gradle version: 6.1.1. +* Minimum Android Gradle Plugin version: 4.0.0. +* Minimum Android SDK: 16. + +### Internal +* None. + + ## 1.0.0 (2022-06-07) ### Breaking Changes diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 984bcfdde5..1f7d686463 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -81,8 +81,13 @@ We use the offical [style guide](https://kotlinlang.org/docs/reference/coding-co ./gradlew ktlintFormat ``` -Note: ktlint does not allow group imports using `.*`. You can configure IntelliJ to disallow this by going to preferences `Editor > Code Style > Kotlin > Imports` and select "Use single name imports". +A pre-push git hook that automatically will perform these checks is available. You can configure it with the following command: +``` +git config core.hooksPath .githooks +``` + +Note: ktlint does not allow group imports using `.*`. You can configure IntelliJ to disallow this by going to preferences `Editor > Code Style > Kotlin > Imports` and select "Use single name imports". ## Multiplatform source layout diff --git a/DEPRECATED-Jenkinsfile b/DEPRECATED-Jenkinsfile index 455a2353cc..59413acbcc 100644 --- a/DEPRECATED-Jenkinsfile +++ b/DEPRECATED-Jenkinsfile @@ -207,7 +207,7 @@ pipeline { steps { testWithServer([ // This will overwrite previous test results, but should be ok as we would not get here - // if previous stages failed. + // if previous stages failed. { testAndCollect("test", "cleanAllTests macosTest -Pkotlin.native.binary.memoryModel=experimental") }, diff --git a/dependencies.list b/dependencies.list index e1f1a479b9..0f3a554a7c 100644 --- a/dependencies.list +++ b/dependencies.list @@ -1,3 +1,11 @@ # Version of MongoDB Realm used by integration tests # See https://github.com/realm/ci/packages/147854 for available versions MONGODB_REALM_SERVER=2022-05-21 + +# `BAAS` and `BAAS-UI` projects commit hashes matching MONGODB_REALM_SERVER image version +# note that the MONGODB_REALM_SERVER image is a nightly build, find the matching commits +# for that date within the following repositories: +# https://github.com/10gen/baas/ +# https://github.com/10gen/baas-ui/ +REALM_BAAS_GIT_HASH=87e4edf99a6510aa8468450e87af69dcfc74abe7 +REALM_BAAS_UI_GIT_HASH=57c5b89882d5492bc0f4971c376e25ba50b65b5f \ No newline at end of file diff --git a/packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/RealmEnums.kt b/packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/RealmEnums.kt index 12f476138d..2a4e798c5c 100644 --- a/packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/RealmEnums.kt +++ b/packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/RealmEnums.kt @@ -37,11 +37,13 @@ expect enum class PropertyType { RLM_PROPERTY_TYPE_INT, RLM_PROPERTY_TYPE_BOOL, RLM_PROPERTY_TYPE_STRING, + RLM_PROPERTY_TYPE_BINARY, RLM_PROPERTY_TYPE_OBJECT, RLM_PROPERTY_TYPE_FLOAT, RLM_PROPERTY_TYPE_DOUBLE, RLM_PROPERTY_TYPE_TIMESTAMP, RLM_PROPERTY_TYPE_OBJECT_ID, + RLM_PROPERTY_TYPE_UUID, ; // Consider adding property methods to make it easier to do generic code on all types. Or is this exactly what collection type is about diff --git a/packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/RealmInterop.kt b/packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/RealmInterop.kt index 66e3fcbb19..8c08218bbb 100644 --- a/packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/RealmInterop.kt +++ b/packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/RealmInterop.kt @@ -159,6 +159,7 @@ expect object RealmInterop { fun realm_is_frozen(realm: RealmPointer): Boolean fun realm_close(realm: RealmPointer) fun realm_delete_files(path: String) + fun realm_convert_with_config(realm: RealmPointer, config: RealmConfigurationPointer) fun realm_get_schema(realm: RealmPointer): RealmSchemaPointer fun realm_get_schema_version(realm: RealmPointer): Long @@ -263,6 +264,7 @@ expect object RealmInterop { fun realm_app_log_in_with_credentials(app: RealmAppPointer, credentials: RealmCredentialsPointer, callback: AppCallback) fun realm_app_log_out(app: RealmAppPointer, user: RealmUserPointer, callback: AppCallback) fun realm_app_remove_user(app: RealmAppPointer, user: RealmUserPointer, callback: AppCallback) + fun realm_app_delete_user(app: RealmAppPointer, user: RealmUserPointer, callback: AppCallback) fun realm_clear_cached_apps() fun realm_app_sync_client_get_default_file_path_for_realm( app: RealmAppPointer, diff --git a/packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/UUIDWrapper.kt b/packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/UUIDWrapper.kt new file mode 100644 index 0000000000..c72585fe94 --- /dev/null +++ b/packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/UUIDWrapper.kt @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Realm Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.realm.kotlin.internal.interop + +/** + * Wrapper around Core UUID values. + * See https://github.com/realm/realm-core/blob/master/src/realm/uuid.hpp for more information + */ +interface UUIDWrapper { + val bytes: ByteArray +} + +// Implementation that should only be used within the cinterop module. +internal data class UUIDWrapperImpl(override val bytes: ByteArray) : UUIDWrapper { + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other == null || this::class != other::class) return false + + other as UUIDWrapperImpl + + if (!bytes.contentEquals(other.bytes)) return false + + return true + } + + override fun hashCode(): Int { + return bytes.contentHashCode() + } +} + +const val UUID_BYTES_SIZE = 16 diff --git a/packages/cinterop/src/darwin/kotlin/io/realm/kotlin/internal/interop/RealmEnums.kt b/packages/cinterop/src/darwin/kotlin/io/realm/kotlin/internal/interop/RealmEnums.kt index 8badf00027..131832945e 100644 --- a/packages/cinterop/src/darwin/kotlin/io/realm/kotlin/internal/interop/RealmEnums.kt +++ b/packages/cinterop/src/darwin/kotlin/io/realm/kotlin/internal/interop/RealmEnums.kt @@ -52,11 +52,14 @@ actual enum class PropertyType(override val nativeValue: UInt) : NativeEnumerate RLM_PROPERTY_TYPE_INT(realm_wrapper.RLM_PROPERTY_TYPE_INT), RLM_PROPERTY_TYPE_BOOL(realm_wrapper.RLM_PROPERTY_TYPE_BOOL), RLM_PROPERTY_TYPE_STRING(realm_wrapper.RLM_PROPERTY_TYPE_STRING), + RLM_PROPERTY_TYPE_BINARY(realm_wrapper.RLM_PROPERTY_TYPE_BINARY), RLM_PROPERTY_TYPE_OBJECT(realm_wrapper.RLM_PROPERTY_TYPE_OBJECT), RLM_PROPERTY_TYPE_FLOAT(realm_wrapper.RLM_PROPERTY_TYPE_FLOAT), RLM_PROPERTY_TYPE_DOUBLE(realm_wrapper.RLM_PROPERTY_TYPE_DOUBLE), RLM_PROPERTY_TYPE_TIMESTAMP(realm_wrapper.RLM_PROPERTY_TYPE_TIMESTAMP), - RLM_PROPERTY_TYPE_OBJECT_ID(realm_wrapper.RLM_PROPERTY_TYPE_OBJECT_ID); + RLM_PROPERTY_TYPE_OBJECT_ID(realm_wrapper.RLM_PROPERTY_TYPE_OBJECT_ID), + RLM_PROPERTY_TYPE_UUID(realm_wrapper.RLM_PROPERTY_TYPE_UUID) + ; actual companion object { actual fun from(nativeValue: Int): PropertyType { diff --git a/packages/cinterop/src/darwin/kotlin/io/realm/kotlin/internal/interop/RealmInterop.kt b/packages/cinterop/src/darwin/kotlin/io/realm/kotlin/internal/interop/RealmInterop.kt index fde09283a3..254abd4321 100644 --- a/packages/cinterop/src/darwin/kotlin/io/realm/kotlin/internal/interop/RealmInterop.kt +++ b/packages/cinterop/src/darwin/kotlin/io/realm/kotlin/internal/interop/RealmInterop.kt @@ -19,7 +19,10 @@ package io.realm.kotlin.internal.interop import io.realm.kotlin.internal.interop.Constants.ENCRYPTION_KEY_LENGTH +import io.realm.kotlin.internal.interop.RealmInterop.asByteArray +import io.realm.kotlin.internal.interop.RealmInterop.asTimestamp import io.realm.kotlin.internal.interop.RealmInterop.safeKString +import io.realm.kotlin.internal.interop.RealmInterop.to_realm_value import io.realm.kotlin.internal.interop.sync.AppError import io.realm.kotlin.internal.interop.sync.AppErrorCategory import io.realm.kotlin.internal.interop.sync.AuthProvider @@ -51,6 +54,7 @@ import kotlinx.cinterop.StableRef import kotlinx.cinterop.UIntVar import kotlinx.cinterop.ULongVar import kotlinx.cinterop.ULongVarOf +import kotlinx.cinterop.addressOf import kotlinx.cinterop.alloc import kotlinx.cinterop.allocArray import kotlinx.cinterop.asStableRef @@ -60,7 +64,6 @@ import kotlinx.cinterop.cstr import kotlinx.cinterop.get import kotlinx.cinterop.getBytes import kotlinx.cinterop.memScoped -import kotlinx.cinterop.nativeHeap.alloc import kotlinx.cinterop.pointed import kotlinx.cinterop.ptr import kotlinx.cinterop.readBytes @@ -69,11 +72,13 @@ import kotlinx.cinterop.set import kotlinx.cinterop.staticCFunction import kotlinx.cinterop.toKString import kotlinx.cinterop.useContents +import kotlinx.cinterop.usePinned import kotlinx.cinterop.value import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineStart import kotlinx.coroutines.launch +import platform.posix.memcpy import platform.posix.posix_errno import platform.posix.pthread_threadid_np import platform.posix.size_tVar @@ -81,6 +86,7 @@ import platform.posix.strerror import platform.posix.uint64_t import platform.posix.uint8_tVar import realm_wrapper.realm_app_error_t +import realm_wrapper.realm_binary_t import realm_wrapper.realm_class_info_t import realm_wrapper.realm_clear_last_error import realm_wrapper.realm_clone @@ -156,6 +162,15 @@ private inline fun NativePointer.cptr(): CPoint return (this as CPointerWrapper).ptr as CPointer } +fun realm_binary_t.set(memScope: MemScope, binary: ByteArray): realm_binary_t { + size = binary.size.toULong() + data = memScope.allocArray(binary.size) + binary.forEachIndexed { index, byte -> + data!![index] = byte.toUByte() + } + return this +} + fun realm_string_t.set(memScope: MemScope, s: String): realm_string_t { val cstr = s.cstr data = cstr.getPointer(memScope) @@ -163,6 +178,7 @@ fun realm_string_t.set(memScope: MemScope, s: String): realm_string_t { return this } +@Suppress("LongMethod", "ComplexMethod") fun realm_value_t.set(memScope: MemScope, realmValue: RealmValue): realm_value_t { val value = realmValue.value when (value) { @@ -208,6 +224,18 @@ fun realm_value_t.set(memScope: MemScope, realmValue: RealmValue): realm_value_t } } } + is UUIDWrapper -> { + type = realm_value_type.RLM_TYPE_UUID + uuid.apply { + value.bytes.usePinned { + memcpy(bytes.getPointer(memScope), it.addressOf(0), UUID_BYTES_SIZE.toULong()) + } + } + } + is ByteArray -> { + type = realm_value_type.RLM_TYPE_BINARY + binary.set(memScope, value) + } else -> TODO("Value conversion not yet implemented for : ${value::class.simpleName}") } @@ -220,20 +248,20 @@ fun realm_value_t.set(memScope: MemScope, realmValue: RealmValue): realm_value_t * * @throws NullPointerException if `realm_string_t` is null. */ -fun realm_string_t.toKString(): String { +fun realm_string_t.toKotlinString(): String { if (size == 0UL) { return "" } val data: CPointer>? = this.data val readBytes: ByteArray? = data?.readBytes(this.size.toInt()) - return readBytes?.toKString()!! + return readBytes?.decodeToString(0, size.toInt(), throwOnInvalidSequence = false)!! } -fun realm_string_t.toNullableKString(): String? { +fun realm_string_t.toNullableKotlinString(): String? { return if (data == null) { null } else { - return toKString() + return toKotlinString() } } @@ -549,6 +577,12 @@ actual object RealmInterop { } } + actual fun realm_convert_with_config(realm: RealmPointer, config: RealmConfigurationPointer) { + memScoped { + checkedBooleanResult(realm_wrapper.realm_convert_with_config(realm.cptr(), config.cptr())) + } + } + actual fun realm_get_schema(realm: RealmPointer): RealmSchemaPointer { return CPointerWrapper(realm_wrapper.realm_get_schema(realm.cptr())) } @@ -784,7 +818,7 @@ actual object RealmInterop { realm_value_type.RLM_TYPE_BOOL -> value.boolean realm_value_type.RLM_TYPE_STRING -> - value.string.toKString() + value.string.toKotlinString() realm_value_type.RLM_TYPE_FLOAT -> value.fnum realm_value_type.RLM_TYPE_DOUBLE -> @@ -793,8 +827,12 @@ actual object RealmInterop { value.asTimestamp() realm_value_type.RLM_TYPE_OBJECT_ID -> value.asObjectId() + realm_value_type.RLM_TYPE_UUID -> + value.asUUID() realm_value_type.RLM_TYPE_LINK -> value.asLink() + realm_value_type.RLM_TYPE_BINARY -> + value.asByteArray() else -> TODO("Unsupported type for from_realm_value ${value.type.name}") } @@ -950,6 +988,14 @@ actual object RealmInterop { } } } + is UUIDWrapper -> { + cvalue.type = realm_value_type.RLM_TYPE_UUID + cvalue.uuid.apply { + value.bytes.usePinned { + memcpy(bytes.getPointer(memScope), it.addressOf(0), UUID_BYTES_SIZE.toULong()) + } + } + } is RealmObjectInterop -> { cvalue.type = realm_value_type.RLM_TYPE_LINK val nativePointer = @@ -961,9 +1007,17 @@ actual object RealmInterop { } } } - // RLM_TYPE_BINARY, + is ByteArray -> { + cvalue.type = realm_value_type.RLM_TYPE_BINARY + cvalue.binary.apply { + data = allocArray(value.size) + value.forEachIndexed { index, byte -> + data?.set(index, byte.toUByte()) + } + size = value.size.toULong() + } + } // RLM_TYPE_DECIMAL128, - // RLM_TYPE_UUID, else -> { TODO("Unsupported type for to_realm_value `${value!!::class.simpleName}`") } @@ -1527,6 +1581,26 @@ actual object RealmInterop { ) } + actual fun realm_app_delete_user( + app: RealmAppPointer, + user: RealmUserPointer, + callback: AppCallback + ) { + checkedBooleanResult( + realm_wrapper.realm_app_delete_user( + app.cptr(), + user.cptr(), + staticCFunction { userData, error -> + handleAppCallback(userData, error) { /* No-op, returns Unit */ } + }, + StableRef.create(callback).asCPointer(), + staticCFunction { userdata -> + disposeUserData>(userdata) + } + ) + ) + } + actual fun realm_clear_cached_apps() { realm_wrapper.realm_clear_cached_apps() } @@ -2039,19 +2113,19 @@ actual object RealmInterop { actual fun realm_sync_subscription_name(subscription: RealmSubscriptionPointer): String? { return realm_wrapper.realm_sync_subscription_name(subscription.cptr()).useContents { - this.toNullableKString() + this.toNullableKotlinString() } } actual fun realm_sync_subscription_object_class_name(subscription: RealmSubscriptionPointer): String { return realm_wrapper.realm_sync_subscription_object_class_name(subscription.cptr()).useContents { - this.toKString() + this.toKotlinString() } } actual fun realm_sync_subscription_query_string(subscription: RealmSubscriptionPointer): String { return realm_wrapper.realm_sync_subscription_query_string(subscription.cptr()).useContents { - this.toKString() + this.toKotlinString() } } @@ -2281,6 +2355,15 @@ actual object RealmInterop { return propertyInfo } + private fun realm_value_t.asByteArray(): ByteArray { + if (this.type != realm_value_type.RLM_TYPE_BINARY) { + error("Value is not of type ByteArray: $this.type") + } + + val size = this.binary.size.toInt() + return requireNotNull(this.binary.data).readBytes(size) + } + private fun realm_value_t.asTimestamp(): Timestamp { if (this.type != realm_value_type.RLM_TYPE_TIMESTAMP) { error("Value is not of type Timestamp: $this.type") @@ -2299,6 +2382,21 @@ actual object RealmInterop { return ObjectIdWrapperImpl(byteArray.asByteArray()) } + private fun realm_value_t.asUUID(): UUIDWrapper { + if (this.type != realm_value_type.RLM_TYPE_UUID) { + error("Value is not of type UUID: $this.type") + } + + memScoped { + val byteArray = UByteArray(UUID_BYTES_SIZE) + byteArray.usePinned { + + memcpy(it.addressOf(0), uuid.bytes.getPointer(this@memScoped), UUID_BYTES_SIZE.toULong()) + } + return UUIDWrapperImpl(byteArray.asByteArray()) + } + } + private fun realm_value_t.asLink(): Link { if (this.type != realm_value_type.RLM_TYPE_LINK) { error("Value is not of type link: $this.type") diff --git a/packages/cinterop/src/darwinTest/kotlin/io/realm/kotlin/test/CinteropTest.kt b/packages/cinterop/src/darwinTest/kotlin/io/realm/kotlin/test/CinteropTest.kt index c2f3fd6fe0..c097678d4d 100644 --- a/packages/cinterop/src/darwinTest/kotlin/io/realm/kotlin/test/CinteropTest.kt +++ b/packages/cinterop/src/darwinTest/kotlin/io/realm/kotlin/test/CinteropTest.kt @@ -29,7 +29,7 @@ import io.realm.kotlin.internal.interop.SchemaMode import io.realm.kotlin.internal.interop.SchemaValidationMode import io.realm.kotlin.internal.interop.coreErrorAsThrowable import io.realm.kotlin.internal.interop.set -import io.realm.kotlin.internal.interop.toKString +import io.realm.kotlin.internal.interop.toKotlinString import kotlinx.cinterop.BooleanVar import kotlinx.cinterop.CPointer import kotlinx.cinterop.CPointerVarOf @@ -214,7 +214,7 @@ class CinteropTest { memScoped { val s = alloc() s.set(memScope, "") - r = s.toKString() + r = s.toKotlinString() } assertEquals("", r) } @@ -226,7 +226,7 @@ class CinteropTest { memScoped { val s = alloc() s.set(memScope, value) - r = s.toKString() + r = s.toKotlinString() } assertEquals(value, r) } diff --git a/packages/cinterop/src/jvm/jni/java_class_global_def.hpp b/packages/cinterop/src/jvm/jni/java_class_global_def.hpp index 17e1d4deb6..0efe83afb4 100644 --- a/packages/cinterop/src/jvm/jni/java_class_global_def.hpp +++ b/packages/cinterop/src/jvm/jni/java_class_global_def.hpp @@ -47,18 +47,19 @@ class JavaClassGlobalDef { , m_java_lang_int(env, "java/lang/Integer", false) , m_kotlin_jvm_functions_function0(env, "kotlin/jvm/functions/Function0", false) , m_kotlin_jvm_functions_function1(env, "kotlin/jvm/functions/Function1", false) - , m_io_realm_kotlinnetwork_transport(env, "io/realm/kotlin/internal/interop/sync/NetworkTransport", false) - , m_io_realm_kotlinresponse(env, "io/realm/kotlin/internal/interop/sync/Response", false) - , m_io_realm_kotlinlong_pointer_wrapper(env, "io/realm/kotlin/internal/interop/LongPointerWrapper", false) - , m_io_realm_kotlininternal_interop_sync_sync_error(env, "io/realm/kotlin/internal/interop/sync/SyncError", false) - , m_io_realm_kotlininternal_interop_sync_app_error(env, "io/realm/kotlin/internal/interop/sync/AppError", false) - , m_io_realm_kotlinsync_log_callback(env, "io/realm/kotlin/internal/interop/SyncLogCallback", false) - , m_io_realm_kotlinsync_error_callback(env, "io/realm/kotlin/internal/interop/SyncErrorCallback", false) - , m_io_realm_kotlinsync_session_transfer_completion_callback(env, "io/realm/kotlin/internal/interop/sync/JVMSyncSessionTransferCompletionCallback", false) - , m_io_realm_kotlininternal_interop_sync_response_callback(env, "io/realm/kotlin/internal/interop/sync/ResponseCallbackImpl", false) - , m_io_realm_kotlininternal_interop_sync_subscriptionset_changed_callback(env, "io/realm/kotlin/internal/interop/SubscriptionSetCallback", false) - , m_io_realm_kotlinsync_interop_sync_before_client_reset_handler(env, "io/realm/kotlin/internal/interop/SyncBeforeClientResetHandler", false) - , m_io_realm_kotlinsync_interop_sync_after_client_reset_handler(env, "io/realm/kotlin/internal/interop/SyncAfterClientResetHandler", false) + , m_io_realm_kotlin_internal_interop_sync_network_transport(env, "io/realm/kotlin/internal/interop/sync/NetworkTransport", false) + , m_io_realm_kotlin_internal_interop_sync_response(env, "io/realm/kotlin/internal/interop/sync/Response", false) + , m_io_realm_kotlin_internal_interop_long_pointer_wrapper(env, "io/realm/kotlin/internal/interop/LongPointerWrapper", false) + , m_io_realm_kotlin_internal_interop_sync_sync_error(env, "io/realm/kotlin/internal/interop/sync/SyncError", false) + , m_io_realm_kotlin_internal_interop_sync_app_error(env, "io/realm/kotlin/internal/interop/sync/AppError", false) + , m_io_realm_kotlin_internal_interop_sync_log_callback(env, "io/realm/kotlin/internal/interop/SyncLogCallback", false) + , m_io_realm_kotlin_internal_interop_sync_error_callback(env, "io/realm/kotlin/internal/interop/SyncErrorCallback", false) + , m_io_realm_kotlin_internal_interop_sync_jvm_sync_session_transfer_completion_callback(env, "io/realm/kotlin/internal/interop/sync/JVMSyncSessionTransferCompletionCallback", false) + , m_io_realm_kotlin_internal_interop_sync_response_callback_impl(env, "io/realm/kotlin/internal/interop/sync/ResponseCallbackImpl", false) + , m_io_realm_kotlin_internal_interop_subscription_set_callback(env, "io/realm/kotlin/internal/interop/SubscriptionSetCallback", false) + , m_io_realm_kotlin_internal_interop_sync_before_client_reset_handler(env, "io/realm/kotlin/internal/interop/SyncBeforeClientResetHandler", false) + , m_io_realm_kotlin_internal_interop_sync_after_client_reset_handler(env, "io/realm/kotlin/internal/interop/SyncAfterClientResetHandler", false) + , m_io_realm_kotlin_internal_interop_core_error_utils(env, "io/realm/kotlin/internal/interop/CoreErrorUtils", false) { } @@ -66,19 +67,19 @@ class JavaClassGlobalDef { jni_util::JavaClass m_java_lang_int; jni_util::JavaClass m_kotlin_jvm_functions_function0; jni_util::JavaClass m_kotlin_jvm_functions_function1; - jni_util::JavaClass m_io_realm_kotlinnetwork_transport; - jni_util::JavaClass m_io_realm_kotlinresponse; - jni_util::JavaClass m_io_realm_kotlinlong_pointer_wrapper; - jni_util::JavaClass m_io_realm_kotlininternal_interop_sync_sync_error; - jni_util::JavaClass m_io_realm_kotlininternal_interop_sync_app_error; - jni_util::JavaClass m_io_realm_kotlinsync_log_callback; - jni_util::JavaClass m_io_realm_kotlinsync_error_callback; - jni_util::JavaClass m_io_realm_kotlinsync_error_code; - jni_util::JavaClass m_io_realm_kotlinsync_session_transfer_completion_callback; - jni_util::JavaClass m_io_realm_kotlininternal_interop_sync_response_callback; - jni_util::JavaClass m_io_realm_kotlininternal_interop_sync_subscriptionset_changed_callback; - jni_util::JavaClass m_io_realm_kotlinsync_interop_sync_before_client_reset_handler; - jni_util::JavaClass m_io_realm_kotlinsync_interop_sync_after_client_reset_handler; + jni_util::JavaClass m_io_realm_kotlin_internal_interop_sync_network_transport; + jni_util::JavaClass m_io_realm_kotlin_internal_interop_sync_response; + jni_util::JavaClass m_io_realm_kotlin_internal_interop_long_pointer_wrapper; + jni_util::JavaClass m_io_realm_kotlin_internal_interop_sync_sync_error; + jni_util::JavaClass m_io_realm_kotlin_internal_interop_sync_app_error; + jni_util::JavaClass m_io_realm_kotlin_internal_interop_sync_log_callback; + jni_util::JavaClass m_io_realm_kotlin_internal_interop_sync_error_callback; + jni_util::JavaClass m_io_realm_kotlin_internal_interop_sync_jvm_sync_session_transfer_completion_callback; + jni_util::JavaClass m_io_realm_kotlin_internal_interop_sync_response_callback_impl; + jni_util::JavaClass m_io_realm_kotlin_internal_interop_subscription_set_callback; + jni_util::JavaClass m_io_realm_kotlin_internal_interop_sync_before_client_reset_handler; + jni_util::JavaClass m_io_realm_kotlin_internal_interop_sync_after_client_reset_handler; + jni_util::JavaClass m_io_realm_kotlin_internal_interop_core_error_utils; inline static std::unique_ptr& instance() { @@ -100,6 +101,11 @@ class JavaClassGlobalDef { instance().release(); } + inline static const jni_util::JavaClass& java_util_hashmap() + { + return instance()->m_java_util_hashmap; + } + inline static jobject new_int(JNIEnv* env, int32_t value) { static jni_util::JavaMethod init(env, @@ -109,68 +115,67 @@ class JavaClassGlobalDef { return env->NewObject(instance()->m_java_lang_int, init, value); } - inline static const jni_util::JavaClass& network_transport_response_class() - { - return instance()->m_io_realm_kotlinresponse; - } - inline static const jni_util::JavaClass& network_transport_class() { - return instance()->m_io_realm_kotlinnetwork_transport; + return instance()->m_io_realm_kotlin_internal_interop_sync_network_transport; } - inline static const jni_util::JavaClass& java_util_hashmap() + inline static const jni_util::JavaClass& network_transport_response_class() { - return instance()->m_java_util_hashmap; + return instance()->m_io_realm_kotlin_internal_interop_sync_response; } inline static const jni_util::JavaClass& long_pointer_wrapper() { - return instance()->m_io_realm_kotlinlong_pointer_wrapper; + return instance()->m_io_realm_kotlin_internal_interop_long_pointer_wrapper; } inline static const jni_util::JavaClass& sync_error() { - return instance()->m_io_realm_kotlininternal_interop_sync_sync_error; + return instance()->m_io_realm_kotlin_internal_interop_sync_sync_error; } inline static const jni_util::JavaClass& app_error() { - return instance()->m_io_realm_kotlininternal_interop_sync_app_error; + return instance()->m_io_realm_kotlin_internal_interop_sync_app_error; } inline static const jni_util::JavaClass& sync_log_callback() { - return instance()->m_io_realm_kotlinsync_log_callback; + return instance()->m_io_realm_kotlin_internal_interop_sync_log_callback; } inline static const jni_util::JavaClass& sync_error_callback() { - return instance()->m_io_realm_kotlinsync_error_callback; + return instance()->m_io_realm_kotlin_internal_interop_sync_error_callback; } inline static const jni_util::JavaClass& sync_session_transfer_completion_callback() { - return instance()->m_io_realm_kotlinsync_session_transfer_completion_callback; + return instance()->m_io_realm_kotlin_internal_interop_sync_jvm_sync_session_transfer_completion_callback; }; inline static const jni_util::JavaClass& app_response_callback() { - return instance()->m_io_realm_kotlininternal_interop_sync_response_callback; + return instance()->m_io_realm_kotlin_internal_interop_sync_response_callback_impl; }; inline static const jni_util::JavaClass& subscriptionset_changed_callback() { - return instance()->m_io_realm_kotlininternal_interop_sync_subscriptionset_changed_callback; + return instance()->m_io_realm_kotlin_internal_interop_subscription_set_callback; } inline static const jni_util::JavaClass& sync_before_client_reset() { - return instance()->m_io_realm_kotlinsync_interop_sync_before_client_reset_handler; + return instance()->m_io_realm_kotlin_internal_interop_sync_before_client_reset_handler; } inline static const jni_util::JavaClass& sync_after_client_reset() { - return instance()->m_io_realm_kotlinsync_interop_sync_after_client_reset_handler; + return instance()->m_io_realm_kotlin_internal_interop_sync_after_client_reset_handler; } + inline static const jni_util::JavaClass& core_error_utils() + { + return instance()->m_io_realm_kotlin_internal_interop_core_error_utils; + } inline static const jni_util::JavaMethod function0Method(JNIEnv* env) { return jni_util::JavaMethod(env, instance()->m_kotlin_jvm_functions_function0, "invoke", diff --git a/packages/cinterop/src/jvm/jni/utils.h b/packages/cinterop/src/jvm/jni/utils.h index 7150a1f560..f2c0232d98 100644 --- a/packages/cinterop/src/jvm/jni/utils.h +++ b/packages/cinterop/src/jvm/jni/utils.h @@ -21,6 +21,8 @@ #include #include "env_utils.h" +#include "realm.h" + using namespace realm; @@ -65,6 +67,21 @@ class JStringAccessor { return std::string(m_data.get(), m_size); } + operator realm_string_t() const noexcept + { + return realm_string_t {m_data.get(), m_size }; + } + + inline const char* data() const noexcept + { + return m_data.get(); + }; + + inline size_t size() const noexcept + { + return m_size; + } + private: JNIEnv* m_env; bool m_is_null; diff --git a/packages/cinterop/src/jvm/kotlin/io/realm/kotlin/internal/interop/PropertyType.kt b/packages/cinterop/src/jvm/kotlin/io/realm/kotlin/internal/interop/PropertyType.kt index a1bfa9918b..824a2e3760 100644 --- a/packages/cinterop/src/jvm/kotlin/io/realm/kotlin/internal/interop/PropertyType.kt +++ b/packages/cinterop/src/jvm/kotlin/io/realm/kotlin/internal/interop/PropertyType.kt @@ -23,11 +23,14 @@ actual enum class PropertyType(override val nativeValue: Int) : NativeEnumerated RLM_PROPERTY_TYPE_BOOL(realm_property_type_e.RLM_PROPERTY_TYPE_BOOL), RLM_PROPERTY_TYPE_INT(realm_property_type_e.RLM_PROPERTY_TYPE_INT), RLM_PROPERTY_TYPE_STRING(realm_property_type_e.RLM_PROPERTY_TYPE_STRING), + RLM_PROPERTY_TYPE_BINARY(realm_property_type_e.RLM_PROPERTY_TYPE_BINARY), RLM_PROPERTY_TYPE_OBJECT(realm_property_type_e.RLM_PROPERTY_TYPE_OBJECT), RLM_PROPERTY_TYPE_FLOAT(realm_property_type_e.RLM_PROPERTY_TYPE_FLOAT), RLM_PROPERTY_TYPE_DOUBLE(realm_property_type_e.RLM_PROPERTY_TYPE_DOUBLE), RLM_PROPERTY_TYPE_TIMESTAMP(realm_property_type_e.RLM_PROPERTY_TYPE_TIMESTAMP), - RLM_PROPERTY_TYPE_OBJECT_ID(realm_property_type_e.RLM_PROPERTY_TYPE_OBJECT_ID); + RLM_PROPERTY_TYPE_OBJECT_ID(realm_property_type_e.RLM_PROPERTY_TYPE_OBJECT_ID), + RLM_PROPERTY_TYPE_UUID(realm_property_type_e.RLM_PROPERTY_TYPE_UUID), + ; // TODO OPTIMIZE actual companion object { diff --git a/packages/cinterop/src/jvm/kotlin/io/realm/kotlin/internal/interop/RealmInterop.kt b/packages/cinterop/src/jvm/kotlin/io/realm/kotlin/internal/interop/RealmInterop.kt index 5b11cf2eea..529b6e77ea 100644 --- a/packages/cinterop/src/jvm/kotlin/io/realm/kotlin/internal/interop/RealmInterop.kt +++ b/packages/cinterop/src/jvm/kotlin/io/realm/kotlin/internal/interop/RealmInterop.kt @@ -17,6 +17,8 @@ package io.realm.kotlin.internal.interop import io.realm.kotlin.internal.interop.Constants.ENCRYPTION_KEY_LENGTH +import io.realm.kotlin.internal.interop.RealmInterop.asLink +import io.realm.kotlin.internal.interop.RealmInterop.cptr import io.realm.kotlin.internal.interop.sync.AuthProvider import io.realm.kotlin.internal.interop.sync.CoreSubscriptionSetState import io.realm.kotlin.internal.interop.sync.CoreSyncSessionState @@ -219,6 +221,10 @@ actual object RealmInterop { } } + actual fun realm_convert_with_config(realm: RealmPointer, config: RealmConfigurationPointer) { + realmc.realm_convert_with_config(realm.cptr(), config.cptr()) + } + actual fun realm_schema_validate(schema: RealmSchemaPointer, mode: SchemaValidationMode): Boolean { return realmc.realm_schema_validate(schema.cptr(), mode.nativeValue.toLong()) } @@ -329,11 +335,29 @@ actual object RealmInterop { } actual fun realm_object_create_with_primary_key(realm: LiveRealmPointer, classKey: ClassKey, primaryKey: RealmValue): RealmObjectPointer { - return LongPointerWrapper(realmc.realm_object_create_with_primary_key(realm.cptr(), classKey.key, to_realm_value(primaryKey))) + return memScope { + LongPointerWrapper( + realmc.realm_object_create_with_primary_key( + realm.cptr(), + classKey.key, + managedRealmValue(primaryKey) + ) + ) + } } + actual fun realm_object_get_or_create_with_primary_key(realm: LiveRealmPointer, classKey: ClassKey, primaryKey: RealmValue): RealmObjectPointer { val created = booleanArrayOf(false) - return LongPointerWrapper(realmc.realm_object_get_or_create_with_primary_key(realm.cptr(), classKey.key, to_realm_value(primaryKey), created)) + return memScope { + LongPointerWrapper( + realmc.realm_object_get_or_create_with_primary_key( + realm.cptr(), + classKey.key, + managedRealmValue(primaryKey), + created + ) + ) + } } actual fun realm_object_is_valid(obj: RealmObjectPointer): Boolean { @@ -395,10 +419,14 @@ actual object RealmInterop { value.asTimestamp() realm_value_type_e.RLM_TYPE_OBJECT_ID -> value.asObjectId() + realm_value_type_e.RLM_TYPE_UUID -> + value.asUUID() realm_value_type_e.RLM_TYPE_LINK -> value.asLink() realm_value_type_e.RLM_TYPE_NULL -> null + realm_value_type_e.RLM_TYPE_BINARY -> + value.binary.data else -> TODO("Unsupported type for from_realm_value ${value.type}") } @@ -406,8 +434,9 @@ actual object RealmInterop { } actual fun realm_set_value(obj: RealmObjectPointer, key: PropertyKey, value: RealmValue, isDefault: Boolean) { - val cvalue = to_realm_value(value) - realmc.realm_set_value(obj.cptr(), key.key, cvalue, isDefault) + memScope { + realmc.realm_set_value(obj.cptr(), key.key, managedRealmValue(value), isDefault) + } } actual fun realm_set_embedded(obj: RealmObjectPointer, key: PropertyKey): RealmObjectPointer { @@ -436,8 +465,9 @@ actual object RealmInterop { } actual fun realm_list_add(list: RealmListPointer, index: Long, value: RealmValue) { - val cvalue = to_realm_value(value) - realmc.realm_list_insert(list.cptr(), index, cvalue) + memScope { + realmc.realm_list_insert(list.cptr(), index, managedRealmValue(value)) + } } actual fun realm_list_insert_embedded(list: RealmListPointer, index: Long): RealmObjectPointer { @@ -446,7 +476,9 @@ actual object RealmInterop { actual fun realm_list_set(list: RealmListPointer, index: Long, value: RealmValue): RealmValue { return realm_list_get(list, index).also { - realmc.realm_list_set(list.cptr(), index, to_realm_value(value)) + memScope { + realmc.realm_list_set(list.cptr(), index, managedRealmValue(value)) + } } } @@ -487,83 +519,6 @@ actual object RealmInterop { return realmc.realm_list_is_valid(list.cptr()) } - // TODO OPTIMIZE Maybe move this to JNI to avoid multiple round trips for allocating and - // updating before actually calling - @Suppress("ComplexMethod", "LongMethod") - private fun to_realm_value(realmValue: RealmValue): realm_value_t { - val cvalue = realm_value_t() - val value = realmValue.value - if (value == null) { - cvalue.type = realm_value_type_e.RLM_TYPE_NULL - } else { - when (value) { - is String -> { - cvalue.type = realm_value_type_e.RLM_TYPE_STRING - cvalue.string = value - } - /*is Byte -> { - cvalue.type = realm_value_type_e.RLM_TYPE_INT - cvalue.integer = value.toLong() - } - is Char -> { - cvalue.type = realm_value_type_e.RLM_TYPE_INT - cvalue.integer = value.toLong() - } - is Short -> { - cvalue.type = realm_value_type_e.RLM_TYPE_INT - cvalue.integer = value.toLong() - } - is Int -> { - cvalue.type = realm_value_type_e.RLM_TYPE_INT - cvalue.integer = value.toLong() - }*/ - is Long -> { - cvalue.type = realm_value_type_e.RLM_TYPE_INT - cvalue.integer = value - } - is Boolean -> { - cvalue.type = realm_value_type_e.RLM_TYPE_BOOL - cvalue._boolean = value - } - is Float -> { - cvalue.type = realm_value_type_e.RLM_TYPE_FLOAT - cvalue.fnum = value - } - is Double -> { - cvalue.type = realm_value_type_e.RLM_TYPE_DOUBLE - cvalue.dnum = value - } - is Timestamp -> { - cvalue.type = realm_value_type_e.RLM_TYPE_TIMESTAMP - cvalue.timestamp = realm_timestamp_t().apply { - seconds = value.seconds - nanoseconds = value.nanoSeconds - } - } - is ObjectIdWrapper -> { - cvalue.type = realm_value_type_e.RLM_TYPE_OBJECT_ID - cvalue.object_id = realm_object_id_t().apply { - val data = ShortArray(OBJECT_ID_BYTES_SIZE) - @OptIn(ExperimentalUnsignedTypes::class) - (0 until OBJECT_ID_BYTES_SIZE).map { - data[it] = value.bytes[it].toShort() - } - bytes = data - } - } - is RealmObjectInterop -> { - val nativePointer = value.objectPointer - cvalue.link = realmc.realm_object_as_link(nativePointer.cptr()) - cvalue.type = realm_value_type_e.RLM_TYPE_LINK - } - else -> { - TODO("Unsupported type for to_realm_value `${value!!::class.simpleName}`") - } - } - } - return cvalue - } - actual fun realm_object_add_notification_callback(obj: RealmObjectPointer, callback: Callback): RealmNotificationTokenPointer { return LongPointerWrapper( realmc.register_object_notification_cb( @@ -737,6 +692,14 @@ actual object RealmInterop { realmc.realm_app_remove_user(app.cptr(), user.cptr(), callback) } + actual fun realm_app_delete_user( + app: RealmAppPointer, + user: RealmUserPointer, + callback: AppCallback + ) { + realmc.realm_app_delete_user(app.cptr(), user.cptr(), callback) + } + actual fun realm_app_get_current_user(app: RealmAppPointer): RealmUserPointer? { val ptr = realmc.realm_app_get_current_user(app.cptr()) return nativePointerOrNull(ptr) @@ -1097,10 +1060,20 @@ actual object RealmInterop { actual fun realm_query_parse(realm: RealmPointer, classKey: ClassKey, query: String, args: Array): RealmQueryPointer { val count = args.size val cArgs = realmc.new_valueArray(count) - args.mapIndexed { i, arg -> - realmc.valueArray_setitem(cArgs, i, to_realm_value(arg)) + return memScope { + args.mapIndexed { i, arg -> + realmc.valueArray_setitem(cArgs, i, managedRealmValue(arg)) + } + LongPointerWrapper( + realmc.realm_query_parse( + realm.cptr(), + classKey.key, + query, + count.toLong(), + cArgs + ) + ) } - return LongPointerWrapper(realmc.realm_query_parse(realm.cptr(), classKey.key, query, count.toLong(), cArgs)) } actual fun realm_query_parse_for_results( @@ -1110,12 +1083,14 @@ actual object RealmInterop { ): RealmQueryPointer { val count = args.size val cArgs = realmc.new_valueArray(count) - args.mapIndexed { i, arg -> - realmc.valueArray_setitem(cArgs, i, to_realm_value(arg)) + return memScope { + args.mapIndexed { i, arg -> + realmc.valueArray_setitem(cArgs, i, managedRealmValue(arg)) + } + LongPointerWrapper( + realmc.realm_query_parse_for_results(results.cptr(), query, count.toLong(), cArgs) + ) } - return LongPointerWrapper( - realmc.realm_query_parse_for_results(results.cptr(), query, count.toLong(), cArgs) - ) } actual fun realm_query_find_first(query: RealmQueryPointer): Link? { @@ -1148,12 +1123,14 @@ actual object RealmInterop { ): RealmQueryPointer { val count = args.size val cArgs = realmc.new_valueArray(count) - args.mapIndexed { i, arg -> - realmc.valueArray_setitem(cArgs, i, to_realm_value(arg)) + return memScope { + args.mapIndexed { i, arg -> + realmc.valueArray_setitem(cArgs, i, managedRealmValue(arg)) + } + LongPointerWrapper( + realmc.realm_query_append_query(query.cptr(), filter, count.toLong(), cArgs) + ) } - return LongPointerWrapper( - realmc.realm_query_append_query(query.cptr(), filter, count.toLong(), cArgs) - ) } actual fun realm_query_get_description(query: RealmQueryPointer): String { @@ -1212,10 +1189,22 @@ actual object RealmInterop { return LongPointerWrapper(realmc.realm_get_object(realm.cptr(), link.classKey.key, link.objKey)) } - actual fun realm_object_find_with_primary_key(realm: RealmPointer, classKey: ClassKey, primaryKey: RealmValue): RealmObjectPointer? { - val cprimaryKey = to_realm_value(primaryKey) - val found = booleanArrayOf(false) - return nativePointerOrNull(realmc.realm_object_find_with_primary_key(realm.cptr(), classKey.key, cprimaryKey, found)) + actual fun realm_object_find_with_primary_key( + realm: RealmPointer, + classKey: ClassKey, + primaryKey: RealmValue + ): RealmObjectPointer? { + return memScope { + val found = booleanArrayOf(false) + nativePointerOrNull( + realmc.realm_object_find_with_primary_key( + realm.cptr(), + classKey.key, + managedRealmValue(primaryKey), + found + ) + ) + } } actual fun realm_results_delete_all(results: RealmResultsPointer) { @@ -1435,6 +1424,15 @@ actual object RealmInterop { return ObjectIdWrapperImpl(byteArray) } + private fun realm_value_t.asUUID(): UUIDWrapper { + if (this.type != realm_value_type_e.RLM_TYPE_UUID) { + error("Value is not of type UUID: $this.type") + } + val byteArray = ByteArray(UUID_BYTES_SIZE) + this.uuid.bytes.mapIndexed { index, b -> byteArray[index] = b.toByte() } + return UUIDWrapperImpl(byteArray) + } + private fun realm_value_t.asLink(): Link { if (this.type != realm_value_type_e.RLM_TYPE_LINK) { error("Value is not of type link: $this.type") @@ -1443,6 +1441,120 @@ actual object RealmInterop { } } +/** + * A factory and container for various resources that can be freed when calling [free]. + * + * The `managedRealmValue` should be used for all C-API methods that takes a realm_value_t as an + * input arguments (contrary to output arguments where the data is managed by the C-API and copied + * out afterwards). + * + * @see memScope + */ +private class MemScope { + val values: MutableSet = mutableSetOf() + + fun managedRealmValue(value: RealmValue): realm_value_t { + val element = capiRealmValue(value) + values.add(element) + return element + } + + fun free() { + values.map { realmc.realm_value_t_cleanup(it) } + } +} + +/** + * A scope providing a [MemScope] that collects the created resources and automatically frees them + * upon exiting the scope. + */ +private fun memScope(block: MemScope.() -> R): R { + val scope = MemScope() + try { + return block(scope) + } finally { + scope.free() + } +} + +// TODO OPTIMIZE Maybe move this to JNI to avoid multiple round trips for allocating and +// updating before actually calling +@Suppress("ComplexMethod", "LongMethod") +private fun capiRealmValue(realmValue: RealmValue): realm_value_t { + val cvalue = realm_value_t() + val value = realmValue.value + if (value == null) { + cvalue.type = realm_value_type_e.RLM_TYPE_NULL + } else { + when (value) { + is String -> { + cvalue.type = realm_value_type_e.RLM_TYPE_STRING + cvalue.string = value + } + is Long -> { + cvalue.type = realm_value_type_e.RLM_TYPE_INT + cvalue.integer = value + } + is Boolean -> { + cvalue.type = realm_value_type_e.RLM_TYPE_BOOL + cvalue._boolean = value + } + is Float -> { + cvalue.type = realm_value_type_e.RLM_TYPE_FLOAT + cvalue.fnum = value + } + is Double -> { + cvalue.type = realm_value_type_e.RLM_TYPE_DOUBLE + cvalue.dnum = value + } + is Timestamp -> { + cvalue.type = realm_value_type_e.RLM_TYPE_TIMESTAMP + cvalue.timestamp = realm_timestamp_t().apply { + seconds = value.seconds + nanoseconds = value.nanoSeconds + } + } + is ObjectIdWrapper -> { + cvalue.type = realm_value_type_e.RLM_TYPE_OBJECT_ID + cvalue.object_id = realm_object_id_t().apply { + val data = ShortArray(OBJECT_ID_BYTES_SIZE) + @OptIn(ExperimentalUnsignedTypes::class) + (0 until OBJECT_ID_BYTES_SIZE).map { + data[it] = value.bytes[it].toShort() + } + bytes = data + } + } + is RealmObjectInterop -> { + val nativePointer = value.objectPointer + cvalue.link = realmc.realm_object_as_link(nativePointer.cptr()) + cvalue.type = realm_value_type_e.RLM_TYPE_LINK + } + is UUIDWrapper -> { + cvalue.type = realm_value_type_e.RLM_TYPE_UUID + cvalue.uuid = realm_uuid_t().apply { + val data = ShortArray(UUID_BYTES_SIZE) + (0 until UUID_BYTES_SIZE).map { + data[it] = value.bytes[it].toShort() + } + bytes = data + } + } + is ByteArray -> { + cvalue.type = realm_value_type_e.RLM_TYPE_BINARY + cvalue.binary = realm_binary_t().apply { + data = value + size = value.size.toLong() + } + } + else -> { + TODO("Unsupported type for capiRealmValue `${value!!::class.simpleName}`") + } + } + } + return cvalue +} + private class JVMScheduler(dispatcher: CoroutineDispatcher) { val scope: CoroutineScope = CoroutineScope(dispatcher) diff --git a/packages/jni-swig-stub/realm.i b/packages/jni-swig-stub/realm.i index 24b987cc23..f87b158769 100644 --- a/packages/jni-swig-stub/realm.i +++ b/packages/jni-swig-stub/realm.i @@ -191,13 +191,27 @@ std::string rlm_stdstr(realm_string_t val) }; } -// Primitive/built in type handling +// String handling typedef jstring realm_string_t; -// TODO OPTIMIZATION Optimize...maybe port JStringAccessor from realm-java -//%typemap(jtype) realm_string_t "String" -//%typemap(jstype) realm_string_t "String" -%typemap(in) (realm_string_t) "$1 = rlm_str(jenv->GetStringUTFChars($arg,0));" -%typemap(out) (realm_string_t) "$result = ($1.data) ? jenv->NewStringUTF(std::string($1.data, 0, $1.size).c_str()) : nullptr;" +// Typemap used for passing realm_string_t into the C-API in situations where the string buffer +// only have to be live across the C-API call. The lifetime is controlled by the `tmp` JStringAccessor. +%typemap(in) realm_string_t (JStringAccessor tmp(jenv, NULL)){ + $1 = tmp = JStringAccessor(jenv, $arg); +} +// Clean up of jstring buffers are managed by the lifetime of the `tmp` JStringAccessor +%typemap(freearg) realm_string_t "" +// Typemap used for passing realm_string_t into the C-API in situations where the string buffer +// needs to be kept alive after returning from C-API call. This will copy the string buffer to the +// heap and this has to be explicitly freed at a later point. +// Currently just matching 'realm_string_t string' arguments to match realm_value_t.string = $input +%typemap(in) realm_string_t string { + auto s = JStringAccessor(jenv, $arg); + auto size = s.size(); + $1.size = size; + $1.data = (char const *) (new char[size]); + memcpy((char *)$1.data, (const char *)s.data(), size); +} +%typemap(out) (realm_string_t) "$result = to_jstring(jenv, StringData{$1.data, $1.size});" %typemap(jstype) void* "long" %typemap(javain) void* "$javainput" @@ -231,10 +245,12 @@ bool throw_as_java_exception(JNIEnv *jenv) { // Invoke CoreErrorUtils.coreErrorAsThrowable() to retrieve an exception instance that // maps to the core error. - jclass error_type_class = (jenv)->FindClass("io/realm/kotlin/internal/interop/CoreErrorUtils"); - static jmethodID error_type_as_exception = (jenv)->GetStaticMethodID(error_type_class, - "coreErrorAsThrowable", - "(ILjava/lang/String;)Ljava/lang/Throwable;"); + const JavaClass& error_type_class = realm::_impl::JavaClassGlobalDef::core_error_utils(); + static JavaMethod error_type_as_exception(jenv, + error_type_class, + "coreErrorAsThrowable", + "(ILjava/lang/String;)Ljava/lang/Throwable;", true); + jstring error_message = (jenv)->NewStringUTF(message.c_str()); jobject exception = (jenv)->CallStaticObjectMethod( @@ -300,6 +316,12 @@ bool throw_as_java_exception(JNIEnv *jenv) { // Enable passing uint8_t* parameters for realm_config_get_encryption_key and realm_config_set_encryption_key as Byte[] %apply int8_t[] {uint8_t *key}; %apply int8_t[] {uint8_t *out_key}; +%apply int8_t[] {const uint8_t* data}; + +%typemap(freearg) const uint8_t* data; +%typemap(out) const uint8_t* data %{ + $result = SWIG_JavaArrayOutSchar(jenv, (signed char *)result, arg1->size); +%} // Enable passing output argument pointers as long[] %apply int64_t[] {void **}; @@ -376,6 +398,12 @@ bool throw_as_java_exception(JNIEnv *jenv) { // FIXME Has this moved? Maybe a merge error in the core master/sync merge %ignore "realm_results_freeze"; +// TODO improve typemaps for freeing ByteArrays. At the moment we assume a realm_binary_t can only +// be inside a realm_value_t and only those instances are freed properly until we refine their +// corresponding typemap. Other usages will possible incur in leaking values, like in +// realm_convert_with_path. +%ignore realm_convert_with_path; + // Still missing from sync implementation %ignore "realm_sync_client_config_set_metadata_encryption_key"; diff --git a/packages/jni-swig-stub/src/main/jni/realm_api_helpers.cpp b/packages/jni-swig-stub/src/main/jni/realm_api_helpers.cpp index efce417cb9..337a15a9fe 100644 --- a/packages/jni-swig-stub/src/main/jni/realm_api_helpers.cpp +++ b/packages/jni-swig-stub/src/main/jni/realm_api_helpers.cpp @@ -563,13 +563,26 @@ jobject convert_to_jvm_sync_error(JNIEnv* jenv, const realm_sync_error_t& error) realm_sync_error_user_info_t user_info = error.user_info_map[i]; user_info_map->insert(std::make_pair(user_info.key, user_info.value)); } + + // We can't only rely on 'error.is_client_reset_requested' (even though we should) to extract + // user info from the error since 'PermissionDenied' are fatal (non-client-reset) errors that + // mark the file for deletion. Having 'original path' in the user_info_map is a side effect of + // using the same code for client reset. if (error.user_info_length > 0) { + auto end_it = user_info_map->end(); + auto original_it = user_info_map->find(error.c_original_file_path_key); + if (end_it != original_it) { + auto original_file_path = original_it->second; + joriginal_file_path = to_jstring(jenv, original_file_path); + } + + // Sync errors may not have the path to the recovery file unless a Client Reset is requested auto recovery_it = user_info_map->find(error.c_recovery_file_path_key); - auto original_file_path = original_it->second; - auto recovery_file_path = recovery_it->second; - joriginal_file_path = to_jstring(jenv, original_file_path); - jrecovery_file_path = to_jstring(jenv, recovery_file_path); + if (error.is_client_reset_requested && (end_it != recovery_it)) { + auto recovery_file_path = recovery_it->second; + jrecovery_file_path = to_jstring(jenv, recovery_file_path); + } } return jenv->NewObject(JavaClassGlobalDef::sync_error(), @@ -689,3 +702,22 @@ sync_after_client_reset_handler(realm_sync_config_t* config, jobject after_handl }; realm_sync_config_set_after_client_reset_handler(config, after_func, user_data, free_func); } + +// Explicit clean up method for releasing heap allocated data of a realm_value_t instance +void +realm_value_t_cleanup(realm_value_t* value) { + switch (value->type) { + case RLM_TYPE_STRING: { + const char* buf = value->string.data; + if (buf) delete buf; + break; + } + case RLM_TYPE_BINARY: { + const uint8_t* buf = value->binary.data; + if (buf) delete buf; + break; + } + default: + break; + } +} diff --git a/packages/jni-swig-stub/src/main/jni/realm_api_helpers.h b/packages/jni-swig-stub/src/main/jni/realm_api_helpers.h index 99f0dacd7a..58c3733b35 100644 --- a/packages/jni-swig-stub/src/main/jni/realm_api_helpers.h +++ b/packages/jni-swig-stub/src/main/jni/realm_api_helpers.h @@ -90,4 +90,8 @@ sync_before_client_reset_handler(realm_sync_config_t* config, jobject before_han void sync_after_client_reset_handler(realm_sync_config_t* config, jobject after_handler); +// Explicit clean up method for releasing heap allocated data of a realm_value_t instance +void +realm_value_t_cleanup(realm_value_t* value); + #endif //TEST_REALM_API_HELPERS_H diff --git a/packages/library-base/proguard-rules-consumer-common.pro b/packages/library-base/proguard-rules-consumer-common.pro index 907ab81bbe..856a747445 100644 --- a/packages/library-base/proguard-rules-consumer-common.pro +++ b/packages/library-base/proguard-rules-consumer-common.pro @@ -14,7 +14,7 @@ } # Utils to convert core errors into Kotlin exceptions --keep class io.realm.kotlin.interop.CoreErrorUtils { +-keep class io.realm.kotlin.internal.interop.CoreErrorUtils { *; } @@ -60,6 +60,9 @@ -keep class io.realm.kotlin.internal.interop.sync.JVMSyncSessionTransferCompletionCallback { *; } +-keep class io.realm.kotlin.internal.interop.sync.ResponseCallback { + *; +} -keep class io.realm.kotlin.internal.interop.sync.ResponseCallbackImpl { *; } diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/Configuration.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/Configuration.kt index 68f5feed6b..274c796abd 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/Configuration.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/Configuration.kt @@ -19,6 +19,7 @@ package io.realm.kotlin import io.realm.kotlin.internal.REALM_FILE_EXTENSION import io.realm.kotlin.internal.RealmInteropBridge import io.realm.kotlin.internal.platform.PATH_SEPARATOR +import io.realm.kotlin.internal.realmObjectCompanionOrNull import io.realm.kotlin.log.LogLevel import io.realm.kotlin.log.RealmLogger import io.realm.kotlin.types.BaseRealmObject @@ -180,6 +181,15 @@ public interface Configuration { ) { init { + // Verify that the schema only contains subclasses of RealmObject and EmbeddedRealmObject + schema.forEach { clazz: KClass -> + if (clazz.realmObjectCompanionOrNull() == null) { + throw IllegalArgumentException( + "Only subclasses of RealmObject and " + + "EmbeddedRealmObject are allowed in the schema. Found: ${clazz.qualifiedName}" + ) + } + } RealmInteropBridge.initialize() } diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/Realm.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/Realm.kt index 065b8d9657..1583b4505c 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/Realm.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/Realm.kt @@ -20,6 +20,7 @@ import io.realm.kotlin.internal.InternalConfiguration import io.realm.kotlin.internal.RealmImpl import io.realm.kotlin.internal.interop.Constants import io.realm.kotlin.internal.interop.RealmInterop +import io.realm.kotlin.internal.platform.fileExists import io.realm.kotlin.notifications.RealmChange import io.realm.kotlin.query.RealmQuery import io.realm.kotlin.types.BaseRealmObject @@ -96,6 +97,7 @@ public interface Realm : TypedRealm { * @throws IllegalStateException if an error occurred while deleting the Realm files. */ public fun deleteRealm(configuration: Configuration) { + if (!fileExists(configuration.path)) return try { RealmInterop.realm_delete_files(configuration.path) } catch (exception: Throwable) { @@ -171,6 +173,28 @@ public interface Realm : TypedRealm { */ public fun asFlow(): Flow> + /** + * Writes a compacted copy of the Realm to the given destination as defined by the + * [targetConfiguration]. The resulting file can be used for a number of purposes: + * + * - Backup of a local realm. + * - Backup of a synchronized realm, but all local changes must be uploaded first. + * - Convert a local realm to a partition-based realm. + * - Convert a synchronized (partition-based or flexible) realm to a local realm. + * + * Encryption can be configured for the target Realm independently from the current Realm. + * + * The destination file cannot already exist. + * + * @param targetConfiguration configuration that defines what type of backup to make and where + * to write it by using [Configuration.path]. + * @throws IllegalArgumentException if [targetConfiguration] points to a file that already exists. + * @throws IllegalArgumentException if [targetConfiguration] has Flexible Sync enabled. + * @throws IllegalStateException if this Realm is a synchronized Realm, and not all client + * changes are integrated in the server. + */ + public fun writeCopyTo(targetConfiguration: Configuration) + /** * Close this realm and all underlying resources. Accessing any methods or Realm Objects after * this method has been called will then an [IllegalStateException]. diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/ConfigurationImpl.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/ConfigurationImpl.kt index a4d5975a42..5aaa26c56b 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/ConfigurationImpl.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/ConfigurationImpl.kt @@ -60,7 +60,8 @@ public open class ConfigurationImpl constructor( private val userEncryptionKey: ByteArray?, compactOnLaunchCallback: CompactOnLaunchCallback?, private val userMigration: RealmMigration?, - initialDataCallback: InitialDataCallback? + initialDataCallback: InitialDataCallback?, + override val isFlexibleSyncConfiguration: Boolean ) : InternalConfiguration { override val path: String diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/Converters.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/Converters.kt index 119f8e8049..0272dbd438 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/Converters.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/Converters.kt @@ -23,11 +23,13 @@ import io.realm.kotlin.internal.interop.Link import io.realm.kotlin.internal.interop.ObjectIdWrapper import io.realm.kotlin.internal.interop.RealmValue import io.realm.kotlin.internal.interop.Timestamp +import io.realm.kotlin.internal.interop.UUIDWrapper import io.realm.kotlin.internal.platform.realmObjectCompanionOrNull import io.realm.kotlin.types.BaseRealmObject import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.RealmUUID import kotlin.native.concurrent.SharedImmutable import kotlin.reflect.KClass @@ -137,7 +139,7 @@ internal object RealmInstantConverter : PassThroughPublicConverter public inline fun realmValueToRealmInstant(realmValue: RealmValue): RealmInstant? = realmValue.value?.let { RealmInstantImpl(it as Timestamp) } -internal object ObjectIdConvert : PassThroughPublicConverter() { +internal object ObjectIdConverter : PassThroughPublicConverter() { override inline fun fromRealmValue(realmValue: RealmValue): ObjectId? = realmValueToObjectId(realmValue) } @@ -145,6 +147,23 @@ internal object ObjectIdConvert : PassThroughPublicConverter() { public inline fun realmValueToObjectId(realmValue: RealmValue): ObjectId? { return realmValue.value?.let { ObjectIdImpl(it as ObjectIdWrapper) } } +internal object RealmUUIDConverter : PassThroughPublicConverter() { + override inline fun fromRealmValue(realmValue: RealmValue): RealmUUID? = + realmValueToRealmUUID(realmValue) +} +// Top level method to allow inlining from compiler plugin +public inline fun realmValueToRealmUUID(realmValue: RealmValue): RealmUUID? { + return realmValue.value?.let { RealmUUIDImpl(it as UUIDWrapper) } +} + +internal object ByteArrayConverter : PassThroughPublicConverter() { + override inline fun fromRealmValue(realmValue: RealmValue): ByteArray? = + realmValueToByteArray(realmValue) +} + +public inline fun realmValueToByteArray(realmValue: RealmValue): ByteArray? { + return realmValue.value?.let { it as ByteArray } +} @SharedImmutable internal val primitiveTypeConverters: Map, RealmValueConverter<*>> = @@ -154,7 +173,9 @@ internal val primitiveTypeConverters: Map, RealmValueConverter<*>> = Short::class to ShortConverter, Int::class to IntConverter, RealmInstant::class to RealmInstantConverter, - ObjectId::class to ObjectIdConvert + ObjectId::class to ObjectIdConverter, + RealmUUID::class to RealmUUIDConverter, + ByteArray::class to ByteArrayConverter ).withDefault { StaticPassThroughConverter } // Dynamic default primitive value converter to translate primary keys and query arguments to RealmValues diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/InternalConfiguration.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/InternalConfiguration.kt index a27330b9c9..cc6182be6e 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/InternalConfiguration.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/InternalConfiguration.kt @@ -36,6 +36,9 @@ public interface InternalConfiguration : Configuration { public val writeDispatcher: CoroutineDispatcher public val schemaMode: SchemaMode + // Temporary work-around for https://github.com/realm/realm-kotlin/issues/724 + public val isFlexibleSyncConfiguration: Boolean + /** * Creates a new native Config object based on all the settings in this configuration. * Each pointer should only be used to open _one_ realm. If you want to open multiple realms diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/ObjectIdImpl.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/ObjectIdImpl.kt index 7dfd2c5417..58cb436d80 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/ObjectIdImpl.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/ObjectIdImpl.kt @@ -3,6 +3,9 @@ package io.realm.kotlin.internal import io.realm.kotlin.internal.interop.OBJECT_ID_BYTES_SIZE import io.realm.kotlin.internal.interop.ObjectIdWrapper import io.realm.kotlin.internal.platform.epochInSeconds +import io.realm.kotlin.internal.util.HEX_PATTERN +import io.realm.kotlin.internal.util.parseHex +import io.realm.kotlin.internal.util.toHexString import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant import kotlinx.atomicfu.AtomicInt @@ -73,7 +76,7 @@ public class ObjectIdImpl : ObjectId, ObjectIdWrapper { * @param hexString the string to convert * @throws IllegalArgumentException if the string is not a valid hex string representation of an ObjectId */ - public constructor(hexString: String) : this(parseHexString(hexString)) + public constructor(hexString: String) : this(parseObjectIdString(hexString)) /** * Constructs a new instance from the given unsigned byte array @@ -119,21 +122,6 @@ public class ObjectIdImpl : ObjectId, ObjectIdWrapper { this._bytes = toByteArray() } - /** - * Converts this instance into a 24-byte hexadecimal string representation. - * - * @return a string representation of the ObjectId in hexadecimal format - */ - private fun toHexString(): String { - val chars = CharArray(OBJECT_ID_BYTES_SIZE * 2) - var i = 0 - for (b in toByteArray()) { - chars[i++] = HEX_CHARS[b.toInt() shr 4 and 0xF] - chars[i++] = HEX_CHARS[b.toInt() and 0xF] - } - return chars.concatToString() - } - /** * Convert to a byte array. Note that the numbers are stored in big-endian order. * @@ -196,7 +184,7 @@ public class ObjectIdImpl : ObjectId, ObjectIdWrapper { } override fun toString(): String { - return toHexString() + return _bytes.toHexString() } private companion object { @@ -208,10 +196,10 @@ public class ObjectIdImpl : ObjectId, ObjectIdWrapper { private val NEXT_COUNTER: AtomicInt = atomic(Random.nextInt()) - private val HEX_CHARS = charArrayOf( - '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' - ) + + private val OBJECT_ID_REGEX by lazy { + "$HEX_PATTERN{24}".toRegex() + } /** * Checks if a string could be an `ObjectId`. @@ -220,40 +208,11 @@ public class ObjectIdImpl : ObjectId, ObjectIdWrapper { * @return whether the string could be an object id * @throws IllegalArgumentException if hexString is null */ - @Suppress("ReturnCount", "LoopWithTooManyJumpStatements") - private fun isValid(hexString: String?): Boolean { - if (hexString == null) { - throw IllegalArgumentException() - } - val len = hexString.length - if (len != 24) { - return false - } - for (i in 0 until len) { - val c = hexString[i] - if (c in '0'..'9') { - continue - } - if (c in 'a'..'f') { - continue - } - if (c in 'A'..'F') { - continue - } - return false - } - return true - } - - private fun parseHexString(s: String): ByteArray { - if (!isValid(s)) { - throw IllegalArgumentException("invalid hexadecimal representation of an ObjectId: [$s]") - } - val b = ByteArray(OBJECT_ID_BYTES_SIZE) - for (i in b.indices) { - b[i] = s.substring(i * 2, i * 2 + 2).toInt(16).toByte() + private fun parseObjectIdString(hexString: String): ByteArray { + if (!OBJECT_ID_REGEX.matches(hexString)) { + throw IllegalArgumentException("invalid hexadecimal representation of an ObjectId: [$hexString]") } - return b + return hexString.parseHex() } // Big-Endian helpers, in this class because all other BSON numbers are little-endian diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmConfigurationImpl.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmConfigurationImpl.kt index 47727d0671..954978c5b4 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmConfigurationImpl.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmConfigurationImpl.kt @@ -59,6 +59,7 @@ internal class RealmConfigurationImpl constructor( encryptionKey, compactOnLaunchCallback, migration, - initialDataCallback + initialDataCallback, + false ), RealmConfiguration diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmImpl.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmImpl.kt index 4884ea6b07..dc30c1c1a5 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmImpl.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmImpl.kt @@ -16,12 +16,15 @@ package io.realm.kotlin.internal +import io.realm.kotlin.Configuration import io.realm.kotlin.MutableRealm import io.realm.kotlin.Realm import io.realm.kotlin.dynamic.DynamicRealm +import io.realm.kotlin.exceptions.RealmException import io.realm.kotlin.internal.dynamic.DynamicRealmImpl import io.realm.kotlin.internal.interop.LiveRealmPointer import io.realm.kotlin.internal.interop.RealmInterop +import io.realm.kotlin.internal.platform.fileExists import io.realm.kotlin.internal.platform.runBlocking import io.realm.kotlin.internal.schema.RealmSchemaImpl import io.realm.kotlin.notifications.RealmChange @@ -194,6 +197,26 @@ public class RealmImpl private constructor( ).flattenConcat() } + override fun writeCopyTo(configuration: Configuration) { + if (fileExists(configuration.path)) { + throw IllegalArgumentException("File already exists at: ${configuration.path}. Realm can only write a copy to an empty path.") + } + val internalConfig = (configuration as InternalConfiguration) + if (internalConfig.isFlexibleSyncConfiguration) { + throw IllegalArgumentException("Creating a copy of a Realm where the target has Flexible Sync enabled is currently not supported.") + } + val configPtr = internalConfig.createNativeConfiguration() + try { + RealmInterop.realm_convert_with_config(realmReference.dbPointer, configPtr) + } catch (ex: RealmException) { + if (ex.message?.contains("Could not write file as not all client changes are integrated in server") == true) { + throw IllegalStateException(ex.message) + } else { + throw ex + } + } + } + override fun registerObserver(t: Thawable>): Flow { return notifier.registerObserver(t) } diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmObjectHelper.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmObjectHelper.kt index 78ac1f0797..954c66a8a8 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmObjectHelper.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmObjectHelper.kt @@ -24,6 +24,7 @@ import io.realm.kotlin.internal.interop.CollectionType import io.realm.kotlin.internal.interop.PropertyKey import io.realm.kotlin.internal.interop.PropertyType import io.realm.kotlin.internal.interop.RealmCoreException +import io.realm.kotlin.internal.interop.RealmCoreLogicException import io.realm.kotlin.internal.interop.RealmCorePropertyNotNullableException import io.realm.kotlin.internal.interop.RealmCorePropertyTypeMismatchException import io.realm.kotlin.internal.interop.RealmInterop @@ -204,6 +205,9 @@ internal object RealmObjectHelper { is RealmCorePropertyTypeMismatchException -> { IllegalArgumentException("Property `${obj.className}.${obj.metadata[key]!!.name}` cannot be assigned with value '${value.value}' of wrong type") } + is RealmCoreLogicException -> { + IllegalArgumentException("Property `${obj.className}.${obj.metadata[key]!!.name}` cannot be assigned with value '${value.value}': ${coreException.message}") + } else -> { throw IllegalStateException( "Cannot set `${obj.className}.$${obj.metadata[key]!!.name}` to `${value.value}`: changing Realm data can only be done on a live object from inside a write transaction. Frozen objects can be turned into live using the 'MutableRealm.findLatest(obj)' API.", diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmObjectReference.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmObjectReference.kt index 953f07dce6..5b9d8e6f14 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmObjectReference.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmObjectReference.kt @@ -49,7 +49,7 @@ public class RealmObjectReference( public override val objectPointer: RealmObjectPointer, ) : RealmStateHolder, - io.realm.kotlin.internal.interop.RealmObjectInterop, + RealmObjectInterop, InternalDeleteable, Observable, ObjectChange>, Flowable> { diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmObjectUtil.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmObjectUtil.kt index 1bc29b25d8..763396b2bf 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmObjectUtil.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmObjectUtil.kt @@ -102,7 +102,7 @@ internal fun RealmObjectReference.toRealmObject(): T = /** * Returns the [RealmObjectCompanion] associated with a given [BaseRealmObject]'s [KClass]. */ -internal inline fun KClass.realmObjectCompanionOrNull(): RealmObjectCompanion? { +internal inline fun KClass<*>.realmObjectCompanionOrNull(): RealmObjectCompanion? { return realmObjectCompanionOrNull(this) } diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmUUIDImpl.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmUUIDImpl.kt new file mode 100644 index 0000000000..2f729bc059 --- /dev/null +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/RealmUUIDImpl.kt @@ -0,0 +1,98 @@ +/* + * Copyright 2022 Realm Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.realm.kotlin.internal + +import io.realm.kotlin.internal.interop.UUIDWrapper +import io.realm.kotlin.internal.util.HEX_PATTERN +import io.realm.kotlin.internal.util.parseHex +import io.realm.kotlin.internal.util.toHexString +import io.realm.kotlin.types.RealmUUID +import kotlin.experimental.and +import kotlin.experimental.or +import kotlin.random.Random + +@Suppress("MagicNumber") +// Public as constructor is inlined in accessor converter method (Converters.kt) +public class RealmUUIDImpl : RealmUUID, UUIDWrapper { + override val bytes: ByteArray + + public constructor(wrapper: UUIDWrapper) : this(wrapper.bytes) + + public constructor() { + bytes = Random.nextBytes(UUID_BYTE_SIZE).apply { + // Set uuid to version 4, 6th byte must be 0x4x + this[6] = this[6] and 0x0F.toByte() + this[6] = this[6] or 0x40.toByte() + + // Set variant, 8th byte must be 0b10xxxxxx or 0b110xxxxx + this[8] = this[8] and 0x3F.toByte() + this[8] = this[8] or 0x80.toByte() + } + } + + public constructor(uuidString: String) { + bytes = parseUUIDString(uuidString) + } + + public constructor(byteArray: ByteArray) { + if (byteArray.size != UUID_BYTE_SIZE) + throw IllegalArgumentException("Invalid 'bytes' size ${byteArray.size}, byte array size must be $UUID_BYTE_SIZE") + + bytes = byteArray + } + + override fun equals(other: Any?): Boolean { + return (other as RealmUUID).bytes.contentEquals(bytes) + } + + override fun hashCode(): Int { + return super.hashCode() + } + + override fun toString(): String { + return bytes.toHexString(0, 4) + + "-" + + bytes.toHexString(4, 6) + + "-" + + bytes.toHexString(6, 8) + + "-" + + bytes.toHexString(8, 10) + + "-" + + bytes.toHexString(10, 16) + } + + public companion object { + private const val UUID_BYTE_SIZE = 16 + private val UUID_REGEX by lazy { + ("($HEX_PATTERN{8})-($HEX_PATTERN{4})-($HEX_PATTERN{4})-($HEX_PATTERN{4})-($HEX_PATTERN{12})").toRegex() + } + + /** + * Validates and parses an UUID string representation into a byte array. + */ + private fun parseUUIDString(uuidString: String): ByteArray { + val matchGroup = UUID_REGEX.matchEntire(uuidString) + ?: throw IllegalArgumentException("Invalid string representation of an UUID: '$uuidString'") + + val byteGroups = (1..5).map { groupIndex -> + matchGroup.groups[groupIndex]!!.value.parseHex() + } + + return byteGroups[0] + byteGroups[1] + byteGroups[2] + byteGroups[3] + byteGroups[4] + } + } +} diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/schema/RealmStorageTypeImpl.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/schema/RealmStorageTypeImpl.kt index a75d5d6fa4..b0026bc693 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/schema/RealmStorageTypeImpl.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/schema/RealmStorageTypeImpl.kt @@ -20,11 +20,13 @@ import io.realm.kotlin.dynamic.DynamicMutableRealmObject import io.realm.kotlin.dynamic.DynamicRealmObject import io.realm.kotlin.internal.ObjectIdImpl import io.realm.kotlin.internal.RealmInstantImpl +import io.realm.kotlin.internal.RealmUUIDImpl import io.realm.kotlin.internal.dynamic.DynamicUnmanagedRealmObject import io.realm.kotlin.schema.RealmStorageType import io.realm.kotlin.types.BaseRealmObject import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant +import io.realm.kotlin.types.RealmUUID import kotlin.reflect.KClass internal object RealmStorageTypeImpl { @@ -33,11 +35,13 @@ internal object RealmStorageTypeImpl { io.realm.kotlin.internal.interop.PropertyType.RLM_PROPERTY_TYPE_INT -> RealmStorageType.INT io.realm.kotlin.internal.interop.PropertyType.RLM_PROPERTY_TYPE_BOOL -> RealmStorageType.BOOL io.realm.kotlin.internal.interop.PropertyType.RLM_PROPERTY_TYPE_STRING -> RealmStorageType.STRING + io.realm.kotlin.internal.interop.PropertyType.RLM_PROPERTY_TYPE_BINARY -> RealmStorageType.BINARY io.realm.kotlin.internal.interop.PropertyType.RLM_PROPERTY_TYPE_OBJECT -> RealmStorageType.OBJECT io.realm.kotlin.internal.interop.PropertyType.RLM_PROPERTY_TYPE_FLOAT -> RealmStorageType.FLOAT io.realm.kotlin.internal.interop.PropertyType.RLM_PROPERTY_TYPE_DOUBLE -> RealmStorageType.DOUBLE io.realm.kotlin.internal.interop.PropertyType.RLM_PROPERTY_TYPE_TIMESTAMP -> RealmStorageType.TIMESTAMP io.realm.kotlin.internal.interop.PropertyType.RLM_PROPERTY_TYPE_OBJECT_ID -> RealmStorageType.OBJECT_ID + io.realm.kotlin.internal.interop.PropertyType.RLM_PROPERTY_TYPE_UUID -> RealmStorageType.UUID else -> error("Unknown storage type: $type") } } @@ -45,6 +49,7 @@ internal object RealmStorageTypeImpl { internal fun KClass.realmStorageType(): KClass<*> = when (this) { ObjectIdImpl::class -> ObjectId::class + RealmUUIDImpl::class -> RealmUUID::class RealmInstantImpl::class -> RealmInstant::class DynamicRealmObject::class, DynamicUnmanagedRealmObject::class, diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/util/Hexadecimal.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/util/Hexadecimal.kt new file mode 100644 index 0000000000..3a7a0b7ab4 --- /dev/null +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/util/Hexadecimal.kt @@ -0,0 +1,56 @@ +/* + * Copyright 2022 Realm Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.realm.kotlin.internal.util + +private val HEX_CHARS = ('0'..'9') + ('a'..'f') + +/** + * Generates an hexadecimal string representation of the byte array. + * + * @return a string representation of [ByteArray] in hexadecimal format. + */ +@Suppress("MagicNumber") +internal fun ByteArray.toHexString(startIndex: Int = 0, endIndex: Int = this.size): String { + val chars = CharArray((endIndex - startIndex) * 2) + + var i = 0 + for (index in startIndex until endIndex) { + val byte = this[index].toInt() + chars[i++] = HEX_CHARS[byte shr 4 and 0xF] + chars[i++] = HEX_CHARS[byte and 0xF] + } + + return chars.concatToString() +} + +/** + * Generates a byte array out of a hexadecimal string representation. + * + * It does not perform any validation, the String size must be even. + * + * @return the [ByteArray] represented by the string. + */ +@Suppress("MagicNumber") +internal fun String.parseHex(): ByteArray { + val byteArray = ByteArray(length / 2) + for (i in byteArray.indices) { + byteArray[i] = substring(i * 2, i * 2 + 2).toInt(16).toByte() + } + return byteArray +} + +internal const val HEX_PATTERN = "[0-9a-fA-F]" diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/schema/RealmStorageType.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/schema/RealmStorageType.kt index bbc6250d03..96ec19be03 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/schema/RealmStorageType.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/schema/RealmStorageType.kt @@ -21,6 +21,7 @@ import io.realm.kotlin.types.EmbeddedRealmObject import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.RealmUUID import kotlin.reflect.KClass /** @@ -44,6 +45,11 @@ public enum class RealmStorageType(public val kClass: KClass<*>) { */ STRING(String::class), + /** + * Storage type for properties of type [ByteArray]. + */ + BINARY(ByteArray::class), + /** * Storage type for properties of type [RealmObject] or [EmbeddedRealmObject]. */ @@ -67,5 +73,10 @@ public enum class RealmStorageType(public val kClass: KClass<*>) { /** * Storage type for properties of type [ObjectId]. */ - OBJECT_ID(ObjectId::class); + OBJECT_ID(ObjectId::class), + + /** + * Storage type for properties of type [RealmUUID]. + */ + UUID(RealmUUID::class); } diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/RealmUUID.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/RealmUUID.kt new file mode 100644 index 0000000000..cb52959257 --- /dev/null +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/RealmUUID.kt @@ -0,0 +1,80 @@ +/* + * Copyright 2022 Realm Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.realm.kotlin.types + +import io.realm.kotlin.internal.RealmUUIDImpl + +/** + * A class that represents an immutable universally unique identifier (UUID). A UUID represents a 128-bit value. + * + * UUIDs created with RealmUUID conforms to RFC 4122 version 4 and are created with random bytes. + */ +@Suppress("EqualsWithHashCodeExist") // Only overwriting equals to make docs available to user +public interface RealmUUID { + public companion object { + /** + * Generates a new [RealmUUID] type 4 (pseudo randomly generated) UUID. + * + * @return A randomly generated UUID + */ + public fun random(): RealmUUID = RealmUUIDImpl() + + /** + * Generates a new [RealmUUID] from the UUID formatted string. UUID are represented as + * 32 hexadecimal (base-16) digits, displayed in five groups separated by hyphens, in the + * form 8-4-4-4-12 for a total of 36 characters (32 hexadecimal characters and 4 hyphens). + * + * @param uuidString A string that specifies a UUID + * @return A UUID with the specified value + * + * @throws IllegalArgumentException if [uuidString] does not match the UUID string format. + */ + public fun from(uuidString: String): RealmUUID = RealmUUIDImpl(uuidString) + + /** + * Generates a new [RealmUUID] based on the specified byte array. A valid UUID is represented + * by a byte array of size 16. + * + * @param bytes A byte array that specifies a UUID + * @return A UUID with the specified value + * + * @throws IllegalArgumentException if [bytes] does not match the required byte array size 16. + */ + public fun from(bytes: ByteArray): RealmUUID = RealmUUIDImpl(bytes) + } + + /** + * The UUID represented as a 16 byte array. + */ + public val bytes: ByteArray + + /** + * Returns a string that represents the UUID. UUID are represented as + * 32 hexadecimal (base-16) digits, displayed in five groups separated by hyphens, in the + * form 8-4-4-4-12 for a total of 36 characters (32 hexadecimal characters and 4 hyphens). + * + * @return uuidString A string that represents an UUID + */ + public override fun toString(): String + + /** + * Two UUIDs are equal if they contain the same value, bit for bit. + * + * @return uuidString A string that represents an UUID + */ + public override fun equals(other: Any?): Boolean +} diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/User.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/User.kt index 32423fb437..24bc77fdb7 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/User.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/User.kt @@ -88,6 +88,21 @@ public interface User { // TODO Document how this method behave if offline public suspend fun remove(): User + /** + * Permanently deletes this user from your Atlas App Services app. + * + * If the user was deleted successfully on Atlas, the user state will be set to + * [State.REMOVED] and any local Realm files owned by the user will be deleted. If + * the server request fails, the local state will not be modified. + * + * All user realms should be closed before calling this method. + * + * @throws IllegalStateException if the user was already removed or not logged in. + * @throws io.realm.kotlin.mongodb.exceptions.ServiceException if a failure occurred when + * communicating with App Services. See [AppException] for details. + */ + public suspend fun delete() + /** * Two Users are considered equal if they have the same user identity and are associated * with the same app. diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/exceptions/ClientResetRequiredException.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/exceptions/ClientResetRequiredException.kt index 6022801b14..697100dc81 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/exceptions/ClientResetRequiredException.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/exceptions/ClientResetRequiredException.kt @@ -33,7 +33,15 @@ public class ClientResetRequiredException constructor( error: SyncError ) : Throwable(message = createMessageFromSyncError(error.errorCode)) { + /** + * Path to the original (local) copy of the realm when the Client Reset event was triggered. + * This realm may contain unsynced changes. + */ public val originalFilePath: String = error.originalFilePath!! + + /** + * Path to the recovery (remote) copy of the realm downloaded from the backend. + */ public val recoveryFilePath: String = error.recoveryFilePath!! /** diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/EmailPasswordAuthImpl.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/EmailPasswordAuthImpl.kt index 021bd1d331..7b5778ae8a 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/EmailPasswordAuthImpl.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/EmailPasswordAuthImpl.kt @@ -86,9 +86,9 @@ internal class EmailPasswordAuthImpl(private val app: RealmAppPointer) : EmailPa Channel>(1).use { channel -> RealmInterop.realm_app_email_password_provider_client_reset_password( app, + Validation.checkEmpty(newPassword, "newPassword"), Validation.checkEmpty(token, "token"), Validation.checkEmpty(tokenId, "tokenId"), - Validation.checkEmpty(newPassword, "newPassword"), channelResultCallback(channel) { // No-op }.freeze() diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/RealmSyncUtils.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/RealmSyncUtils.kt index 99161fd815..dd420db8f4 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/RealmSyncUtils.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/RealmSyncUtils.kt @@ -91,6 +91,10 @@ internal fun convertSyncErrorCode(error: SyncErrorCode): SyncException { ProtocolSessionErrorCode.RLM_SYNC_ERR_SESSION_BAD_QUERY -> { // Flexible Sync Query was rejected by the server BadFlexibleSyncQueryException(message) } + ProtocolSessionErrorCode.RLM_SYNC_ERR_SESSION_PERMISSION_DENIED -> + // Permission denied errors should be unrecoverable according to Core, i.e. the + // client will disconnect sync and transition to the "inactive" state + UnrecoverableSyncException(message) else -> SyncException(message) } } diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/SyncSessionImpl.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/SyncSessionImpl.kt index 8c7ada769e..634959877f 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/SyncSessionImpl.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/SyncSessionImpl.kt @@ -148,9 +148,11 @@ internal open class SyncSessionImpl( channel.receive() } } - if (direction == TransferDirection.DOWNLOAD) { - realm.refresh() - } + // We need to refresh the public Realm when downloading to make the changes visible + // to users immediately. + // We need to refresh the public Realm when uploading in order to support functionality + // like `Realm.writeCopyTo()` which require that all changes are uploaded. + realm.refresh() when (result) { is Boolean -> return result is Throwable -> throw result diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/UserImpl.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/UserImpl.kt index 748d00faa7..2660720e6c 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/UserImpl.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/UserImpl.kt @@ -69,6 +69,23 @@ public class UserImpl( return this } + override suspend fun delete() { + if (state != User.State.LOGGED_IN) { + throw IllegalStateException("User must be logged in, in order to be deleted.") + } + Channel>(1).use { channel -> + RealmInterop.realm_app_delete_user( + app.nativePointer, + nativePointer, + channelResultCallback(channel) { + // No-op + }.freeze() + ) + return@use channel.receive() + .getOrThrow() + } + } + override fun equals(other: Any?): Boolean { if (this === other) return true if (other == null || this::class != other::class) return false diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/PartitionValue.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/PartitionValue.kt index 6a1b66d0a8..6a958029a1 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/PartitionValue.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/PartitionValue.kt @@ -17,6 +17,7 @@ package io.realm.kotlin.mongodb.sync import io.realm.kotlin.types.ObjectId +import io.realm.kotlin.types.RealmUUID /** * Value container à la BsonValue. This is only meant to be used temporarily until the BSON library @@ -28,6 +29,7 @@ internal class PartitionValue private constructor(private val bsonValue: Any?) { constructor(value: Long?) : this(bsonValue = value) constructor(value: Int?) : this(bsonValue = value) constructor(value: ObjectId?) : this(bsonValue = value) + constructor(value: RealmUUID?) : this(bsonValue = value) private val valueType: ValueType @@ -37,6 +39,7 @@ internal class PartitionValue private constructor(private val bsonValue: Any?) { is Long -> ValueType.LONG is Int -> ValueType.INT is ObjectId -> ValueType.OBJECT_ID + is RealmUUID -> ValueType.UUID null -> ValueType.NULL else -> { TODO("Unsupported type: ${bsonValue::class}") @@ -44,8 +47,8 @@ internal class PartitionValue private constructor(private val bsonValue: Any?) { } } - private enum class ValueType { - STRING, LONG, INT, NULL, OBJECT_ID + internal enum class ValueType { + STRING, LONG, INT, NULL, OBJECT_ID, UUID } /** @@ -58,6 +61,7 @@ internal class PartitionValue private constructor(private val bsonValue: Any?) { ValueType.LONG -> """{"${'$'}numberLong":"${bsonValue as Long}"}""" ValueType.INT -> """{"${'$'}numberInt":"${bsonValue as Int}"}""" ValueType.OBJECT_ID -> """{"${'$'}oid":"${bsonValue as ObjectId}"}""" + ValueType.UUID -> """{"${'$'}uuid":"${bsonValue as RealmUUID}"}""" ValueType.NULL -> """null""" // TODO Is this true } } diff --git a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SyncConfiguration.kt b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SyncConfiguration.kt index b222021b42..cbf5824f87 100644 --- a/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SyncConfiguration.kt +++ b/packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/sync/SyncConfiguration.kt @@ -39,8 +39,9 @@ import io.realm.kotlin.mongodb.exceptions.ClientResetRequiredException import io.realm.kotlin.mongodb.exceptions.SyncException import io.realm.kotlin.mongodb.internal.SyncConfigurationImpl import io.realm.kotlin.mongodb.internal.UserImpl +import io.realm.kotlin.types.BaseRealmObject import io.realm.kotlin.types.ObjectId -import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.RealmUUID import kotlin.reflect.KClass import kotlin.time.Duration @@ -209,7 +210,7 @@ public interface SyncConfiguration : Configuration { public class Builder private constructor( private var user: User, private var partitionValue: PartitionValue?, - schema: Set>, + schema: Set>, ) : Configuration.SharedBuilder(schema) { // Shouldn't default to 'default.realm' - Object Store will generate it according to which @@ -234,7 +235,7 @@ public interface SyncConfiguration : Configuration { */ public constructor( user: User, - schema: Set> + schema: Set> ) : this(user, null as PartitionValue?, schema) /** @@ -254,7 +255,27 @@ public interface SyncConfiguration : Configuration { public constructor( user: User, partitionValue: ObjectId?, - schema: Set> + schema: Set> + ) : this(user, PartitionValue(partitionValue), schema) + + /** + * Creates a [SyncConfiguration.Builder] for Partition-Based Sync. Partition-Based Sync + * must be enabled on the server for this to work. + * + * **See:** [Partitions](https://www.mongodb.com/docs/realm/sync/data-access-patterns/partitions/) + * + * @param user user used to access server side data. This will define which data is + * available from the server. + * @param partitionValue the partition value to use data from. The server must have been + * configured with a [RealmUUID] partition key for this to work. + * @param schema the classes of the schema. The elements of the set must be direct class + * literals. + * **See:** [partition key](https://www.mongodb.com/docs/realm/sync/data-access-patterns/partitions/) + */ + public constructor( + user: User, + partitionValue: RealmUUID?, + schema: Set> ) : this(user, PartitionValue(partitionValue), schema) /** @@ -271,7 +292,7 @@ public interface SyncConfiguration : Configuration { public constructor( user: User, partitionValue: Int?, - schema: Set> + schema: Set> ) : this(user, PartitionValue(partitionValue), schema) /** @@ -290,7 +311,7 @@ public interface SyncConfiguration : Configuration { public constructor( user: User, partitionValue: Long?, - schema: Set> + schema: Set> ) : this(user, PartitionValue(partitionValue), schema) /** @@ -309,7 +330,7 @@ public interface SyncConfiguration : Configuration { public constructor( user: User, partitionValue: String?, - schema: Set> + schema: Set> ) : this(user, PartitionValue(partitionValue), schema) init { @@ -529,7 +550,8 @@ public interface SyncConfiguration : Configuration { encryptionKey, compactOnLaunchCallback, null, // migration is not relevant for sync, - initialDataCallback + initialDataCallback, + partitionValue == null ) return SyncConfigurationImpl( @@ -587,7 +609,7 @@ public interface SyncConfiguration : Configuration { * literals. * @throws IllegalArgumentException if the user is not valid and logged in. */ - public fun create(user: User, schema: Set>): SyncConfiguration = + public fun create(user: User, schema: Set>): SyncConfiguration = Builder(user, schema).build() /** @@ -605,7 +627,7 @@ public interface SyncConfiguration : Configuration { public fun create( user: User, partitionValue: String?, - schema: Set> + schema: Set> ): SyncConfiguration = Builder(user, partitionValue, schema).build() @@ -624,7 +646,7 @@ public interface SyncConfiguration : Configuration { public fun create( user: User, partitionValue: Int?, - schema: Set> + schema: Set> ): SyncConfiguration = Builder(user, partitionValue, schema).build() @@ -643,7 +665,7 @@ public interface SyncConfiguration : Configuration { public fun create( user: User, partitionValue: Long?, - schema: Set> + schema: Set> ): SyncConfiguration = Builder(user, partitionValue, schema).build() @@ -657,7 +679,20 @@ public interface SyncConfiguration : Configuration { * @throws IllegalArgumentException if the user is not valid and logged in. * * **See:** [partition key](https://www.mongodb.com/docs/realm/sync/data-access-patterns/partitions/) */ - public fun create(user: User, partitionValue: ObjectId?, schema: Set>): SyncConfiguration = + public fun create(user: User, partitionValue: ObjectId?, schema: Set>): SyncConfiguration = + Builder(user, partitionValue, schema).build() + + /** + * Creates a sync configuration for Partition-based Sync with default values for all + * optional configuration parameters. + * + * @param user the [User] who controls the realm. + * @param partitionValue the partition value that defines which data to sync to the realm. + * @param schema the classes of the schema. The elements of the set must be direct class literals. + * @throws IllegalArgumentException if the user is not valid and logged in. + * * **See:** [partition key](https://www.mongodb.com/docs/realm/sync/data-access-patterns/partitions/) + */ + public fun create(user: User, partitionValue: RealmUUID?, schema: Set>): SyncConfiguration = Builder(user, partitionValue, schema).build() } } diff --git a/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/AccessorModifierIrGeneration.kt b/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/AccessorModifierIrGeneration.kt index 58fdb5ee26..7b89b0ef07 100644 --- a/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/AccessorModifierIrGeneration.kt +++ b/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/AccessorModifierIrGeneration.kt @@ -22,6 +22,7 @@ import io.realm.kotlin.compiler.FqNames.REALM_LIST import io.realm.kotlin.compiler.FqNames.REALM_OBJECT_HELPER import io.realm.kotlin.compiler.FqNames.REALM_OBJECT_ID import io.realm.kotlin.compiler.FqNames.REALM_OBJECT_INTERFACE +import io.realm.kotlin.compiler.FqNames.REALM_UUID import io.realm.kotlin.compiler.Names.OBJECT_REFERENCE import io.realm.kotlin.compiler.Names.REALM_OBJECT_HELPER_GET_LIST import io.realm.kotlin.compiler.Names.REALM_OBJECT_HELPER_GET_OBJECT @@ -58,6 +59,7 @@ import org.jetbrains.kotlin.ir.types.IrType import org.jetbrains.kotlin.ir.types.classifierOrFail import org.jetbrains.kotlin.ir.types.isBoolean import org.jetbrains.kotlin.ir.types.isByte +import org.jetbrains.kotlin.ir.types.isByteArray import org.jetbrains.kotlin.ir.types.isChar import org.jetbrains.kotlin.ir.types.isDouble import org.jetbrains.kotlin.ir.types.isFloat @@ -94,6 +96,7 @@ class AccessorModifierIrGeneration(private val pluginContext: IrPluginContext) { private val realmObjectInterface = pluginContext.referenceClass(REALM_OBJECT_INTERFACE) private val embeddedRealmObjectInterface = pluginContext.referenceClass(EMBEDDED_OBJECT_INTERFACE) private val objectIdClass: IrClass = pluginContext.lookupClassOrThrow(REALM_OBJECT_ID) + private val realmUUIDClass: IrClass = pluginContext.lookupClassOrThrow(REALM_UUID) private val getValue: IrSimpleFunction = realmObjectHelper.lookupFunction(REALM_OBJECT_HELPER_GET_VALUE) @@ -137,6 +140,8 @@ class AccessorModifierIrGeneration(private val pluginContext: IrPluginContext) { pluginContext.referenceFunctions(FqName("io.realm.kotlin.internal.realmValueToRealmInstant")).first().owner private val realmValueToObjectId: IrSimpleFunction = pluginContext.referenceFunctions(FqName("io.realm.kotlin.internal.realmValueToObjectId")).first().owner + private val realmValueToRealmUUID: IrSimpleFunction = + pluginContext.referenceFunctions(FqName("io.realm.kotlin.internal.realmValueToRealmUUID")).first().owner private lateinit var objectReferenceProperty: IrProperty private lateinit var objectReferenceType: IrType @@ -172,6 +177,19 @@ class AccessorModifierIrGeneration(private val pluginContext: IrPluginContext) { excludeProperty -> { logDebug("Property named ${declaration.name} ignored") } + propertyType.isByteArray() -> { + logDebug("ByteArray property named ${declaration.name} is ${if (nullable) "" else "not "}nullable") + fields[name] = SchemaProperty( + propertyType = PropertyType.RLM_PROPERTY_TYPE_BINARY, + declaration = declaration, + collectionType = CollectionType.NONE + ) + modifyAccessor( + declaration, + getFunction = getValue, + setFunction = setValue + ) + } propertyType.isString() -> { logDebug("String property named ${declaration.name} is ${if (nullable) "" else "not "}nullable") fields[name] = SchemaProperty( @@ -325,6 +343,20 @@ class AccessorModifierIrGeneration(private val pluginContext: IrPluginContext) { setFunction = setValue ) } + propertyType.isRealmUUID() -> { + logDebug("RealmUUID property named ${declaration.name} is ${if (nullable) "" else "not "}nullable") + fields[name] = SchemaProperty( + propertyType = PropertyType.RLM_PROPERTY_TYPE_UUID, + declaration = declaration, + collectionType = CollectionType.NONE + ) + modifyAccessor( + declaration, + getFunction = getValue, + fromRealmValue = realmValueToRealmUUID, + setFunction = setValue + ) + } propertyType.isRealmList() -> { logDebug("RealmList property named ${declaration.name} is ${if (nullable) "" else "not "}nullable") processListField(fields, name, declaration) @@ -615,6 +647,12 @@ class AccessorModifierIrGeneration(private val pluginContext: IrPluginContext) { return propertyClassId == objectIdClassId } + private fun IrType.isRealmUUID(): Boolean { + val propertyClassId = this.classifierOrFail.descriptor.classId + val realmUUIDClassId = realmUUIDClass.descriptor.classId + return propertyClassId == realmUUIDClassId + } + @Suppress("ReturnCount") private fun getListGenericCoreType(declaration: IrProperty): CoreType? { // Check first if the generic is a subclass of RealmObject @@ -625,7 +663,6 @@ class AccessorModifierIrGeneration(private val pluginContext: IrPluginContext) { if (listGenericType.isNullable()) { logError( "Error in field ${declaration.name} - RealmLists does not support nullable realm objects element types.", - declaration.locationOf() ) return null @@ -676,6 +713,8 @@ class AccessorModifierIrGeneration(private val pluginContext: IrPluginContext) { "String" -> PropertyType.RLM_PROPERTY_TYPE_STRING "RealmInstant" -> PropertyType.RLM_PROPERTY_TYPE_TIMESTAMP "ObjectId" -> PropertyType.RLM_PROPERTY_TYPE_OBJECT_ID + "RealmUUID" -> PropertyType.RLM_PROPERTY_TYPE_UUID + "ByteArray" -> PropertyType.RLM_PROPERTY_TYPE_BINARY else -> if (inheritsFromRealmObject(type.supertypes())) { PropertyType.RLM_PROPERTY_TYPE_OBJECT diff --git a/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/Identifiers.kt b/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/Identifiers.kt index c2f933407e..ca7192b845 100644 --- a/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/Identifiers.kt +++ b/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/Identifiers.kt @@ -94,4 +94,5 @@ internal object FqNames { val REALM_LIST = FqName("io.realm.kotlin.types.RealmList") val REALM_INSTANT = FqName("io.realm.kotlin.types.RealmInstant") val REALM_OBJECT_ID = FqName("io.realm.kotlin.types.ObjectId") + val REALM_UUID = FqName("io.realm.kotlin.types.RealmUUID") } diff --git a/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/IrUtils.kt b/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/IrUtils.kt index 68fb1211be..c3aab0ef6d 100644 --- a/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/IrUtils.kt +++ b/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/IrUtils.kt @@ -231,11 +231,13 @@ enum class PropertyType { RLM_PROPERTY_TYPE_INT, RLM_PROPERTY_TYPE_BOOL, RLM_PROPERTY_TYPE_STRING, + RLM_PROPERTY_TYPE_BINARY, RLM_PROPERTY_TYPE_OBJECT, RLM_PROPERTY_TYPE_FLOAT, RLM_PROPERTY_TYPE_DOUBLE, RLM_PROPERTY_TYPE_TIMESTAMP, - RLM_PROPERTY_TYPE_OBJECT_ID + RLM_PROPERTY_TYPE_OBJECT_ID, + RLM_PROPERTY_TYPE_UUID, } data class CoreType( diff --git a/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/RealmModelLoweringExtension.kt b/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/RealmModelLoweringExtension.kt index d1f92e36f0..2abfd3f7d7 100644 --- a/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/RealmModelLoweringExtension.kt +++ b/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/RealmModelLoweringExtension.kt @@ -84,9 +84,9 @@ private class RealmModelLowering(private val pluginContext: IrPluginContext) : C pluginContext.lookupClassOrThrow(REALM_OBJECT_INTERNAL_INTERFACE).symbol irClass.superTypes += realmObjectInternalInterface.defaultType - // Generate RealmObjectInterop properties overrides + // Generate RealmObjectInternal properties overrides val generator = RealmModelSyntheticPropertiesGeneration(pluginContext) - generator.addProperties(irClass) + generator.addRealmObjectInternalProperties(irClass) // Modify properties accessor to generate custom getter/setter AccessorModifierIrGeneration(pluginContext).modifyPropertiesAndCollectSchema(irClass) diff --git a/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/RealmModelSyntheticPropertiesGeneration.kt b/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/RealmModelSyntheticPropertiesGeneration.kt index 23946dacfd..07b66e33de 100644 --- a/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/RealmModelSyntheticPropertiesGeneration.kt +++ b/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/RealmModelSyntheticPropertiesGeneration.kt @@ -29,10 +29,10 @@ import io.realm.kotlin.compiler.FqNames.PROPERTY_INFO import io.realm.kotlin.compiler.FqNames.PROPERTY_TYPE import io.realm.kotlin.compiler.FqNames.REALM_INSTANT import io.realm.kotlin.compiler.FqNames.REALM_MODEL_COMPANION -import io.realm.kotlin.compiler.FqNames.REALM_NATIVE_POINTER import io.realm.kotlin.compiler.FqNames.REALM_OBJECT_ID import io.realm.kotlin.compiler.FqNames.REALM_OBJECT_INTERFACE import io.realm.kotlin.compiler.FqNames.REALM_OBJECT_INTERNAL_INTERFACE +import io.realm.kotlin.compiler.FqNames.REALM_UUID import io.realm.kotlin.compiler.Names.CLASS_INFO_CREATE import io.realm.kotlin.compiler.Names.OBJECT_REFERENCE import io.realm.kotlin.compiler.Names.PROPERTY_COLLECTION_TYPE_LIST @@ -83,7 +83,6 @@ import org.jetbrains.kotlin.ir.expressions.impl.IrSetFieldImpl import org.jetbrains.kotlin.ir.expressions.impl.IrVarargImpl import org.jetbrains.kotlin.ir.types.IrType import org.jetbrains.kotlin.ir.types.classifierOrFail -import org.jetbrains.kotlin.ir.types.createType import org.jetbrains.kotlin.ir.types.isNullable import org.jetbrains.kotlin.ir.types.isSubtypeOfClass import org.jetbrains.kotlin.ir.types.makeNullable @@ -102,7 +101,7 @@ import org.jetbrains.kotlin.util.capitalizeDecapitalize.toLowerCaseAsciiOnly /** * Helper to assisting in modifying classes marked with the [RealmObject] interface according to our * needs: - * - Adding the internal properties of [io.realm.kotlin.internal.interop.RealmObjectInterop] + * - Adding the internal properties of [io.realm.kotlin.internal.RealmObjectInternal] * - Adding the internal properties and methods of [RealmObjectCompanion] to the associated companion. */ class RealmModelSyntheticPropertiesGeneration(private val pluginContext: IrPluginContext) { @@ -112,9 +111,6 @@ class RealmModelSyntheticPropertiesGeneration(private val pluginContext: IrPlugi pluginContext.lookupClassOrThrow(EMBEDDED_OBJECT_INTERFACE) private val realmModelInternalInterface: IrClass = pluginContext.lookupClassOrThrow(REALM_OBJECT_INTERNAL_INTERFACE) - private val nullableNativePointerInterface = - pluginContext.lookupClassOrThrow(REALM_NATIVE_POINTER) - .symbol.createType(true, emptyList()) private val realmObjectCompanionInterface = pluginContext.lookupClassOrThrow(REALM_MODEL_COMPANION) private val classInfoClass = pluginContext.lookupClassOrThrow(CLASS_INFO) @@ -133,6 +129,7 @@ class RealmModelSyntheticPropertiesGeneration(private val pluginContext: IrPlugi private val objectReferenceClass = pluginContext.lookupClassOrThrow(OBJECT_REFERENCE_CLASS) private val realmInstantType: IrType = pluginContext.lookupClassOrThrow(REALM_INSTANT).defaultType private val objectIdType: IrType = pluginContext.lookupClassOrThrow(REALM_OBJECT_ID).defaultType + private val realmUUIDType: IrType = pluginContext.lookupClassOrThrow(REALM_UUID).defaultType private val kProperty1Class: IrClass = pluginContext.lookupClassOrThrow(FqNames.KOTLIN_REFLECT_KPROPERTY1) @@ -158,22 +155,26 @@ class RealmModelSyntheticPropertiesGeneration(private val pluginContext: IrPlugi realmObjectPropertyType ) - private val listIrClass: IrClass = - pluginContext.lookupClassOrThrow(FqNames.KOTLIN_COLLECTIONS_LIST) val realmClassImpl = pluginContext.lookupClassOrThrow(FqNames.REALM_CLASS_IMPL) private val realmClassCtor = pluginContext.lookupConstructorInClass(FqNames.REALM_CLASS_IMPL) { it.owner.valueParameters.size == 2 } - fun addProperties(irClass: IrClass): IrClass = - irClass.apply { + /** + * Add fields required to satisfy the `RealmObjectInternal` contract. + */ + fun addRealmObjectInternalProperties(irClass: IrClass): IrClass { + // RealmObjectReference should use the model class name as the generic argument. + val type: IrType = objectReferenceClass.typeWith(irClass.defaultType).makeNullable() + return irClass.apply { addVariableProperty( realmModelInternalInterface, OBJECT_REFERENCE, - objectReferenceClass.defaultType.makeNullable(), + type, ::irNull ) } + } @Suppress("LongMethod") fun addCompanionFields( @@ -430,7 +431,8 @@ class RealmModelSyntheticPropertiesGeneration(private val pluginContext: IrPlugi intType, longType, stringType, - objectIdType + objectIdType, + realmUUIDType ).map { it.classifierOrFail } } if (primaryKey && backingField.type.classifierOrFail !in validPrimaryKeyTypes) { @@ -440,7 +442,7 @@ class RealmModelSyntheticPropertiesGeneration(private val pluginContext: IrPlugi ) } val indexableTypes = with(pluginContext.irBuiltIns) { - setOf(byteType, charType, shortType, intType, longType, stringType, realmInstantType, objectIdType).map { it.classifierOrFail } + setOf(byteType, charType, shortType, intType, longType, stringType, realmInstantType, objectIdType, realmUUIDType).map { it.classifierOrFail } } if (isIndexed && backingField.type.classifierOrFail !in indexableTypes) { logError( diff --git a/packages/plugin-compiler/src/test/kotlin/io/realm/kotlin/compiler/GenerationExtensionTest.kt b/packages/plugin-compiler/src/test/kotlin/io/realm/kotlin/compiler/GenerationExtensionTest.kt index 74c096385c..c275220b58 100644 --- a/packages/plugin-compiler/src/test/kotlin/io/realm/kotlin/compiler/GenerationExtensionTest.kt +++ b/packages/plugin-compiler/src/test/kotlin/io/realm/kotlin/compiler/GenerationExtensionTest.kt @@ -173,6 +173,8 @@ class GenerationExtensionTest { "doubleField" to PropertyType.RLM_PROPERTY_TYPE_DOUBLE, "timestampField" to PropertyType.RLM_PROPERTY_TYPE_TIMESTAMP, "objectIdField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT_ID, + "uuidField" to PropertyType.RLM_PROPERTY_TYPE_UUID, + "byteArrayField" to PropertyType.RLM_PROPERTY_TYPE_BINARY, // RealmObject "child" to PropertyType.RLM_PROPERTY_TYPE_OBJECT, @@ -189,7 +191,9 @@ class GenerationExtensionTest { "doubleListField" to PropertyType.RLM_PROPERTY_TYPE_DOUBLE, "timestampListField" to PropertyType.RLM_PROPERTY_TYPE_TIMESTAMP, "objectIdListField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT_ID, + "uuidListField" to PropertyType.RLM_PROPERTY_TYPE_UUID, "objectListField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT, + "binaryListField" to PropertyType.RLM_PROPERTY_TYPE_BINARY, "embeddedRealmObjectListField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT, // Nullable list types @@ -204,6 +208,8 @@ class GenerationExtensionTest { "nullableDoubleListField" to PropertyType.RLM_PROPERTY_TYPE_DOUBLE, "nullableTimestampListField" to PropertyType.RLM_PROPERTY_TYPE_TIMESTAMP, "nullableObjectIdListField" to PropertyType.RLM_PROPERTY_TYPE_OBJECT_ID, + "nullableUUIDListField" to PropertyType.RLM_PROPERTY_TYPE_UUID, + "nullableBinaryListField" to PropertyType.RLM_PROPERTY_TYPE_BINARY, ) assertEquals(expectedProperties.size, properties.size) properties.map { property -> diff --git a/packages/plugin-compiler/src/test/resources/sample/expected/00_ValidateIrBeforeLowering.ir b/packages/plugin-compiler/src/test/resources/sample/expected/00_ValidateIrBeforeLowering.ir index a6118139f9..59c66da966 100644 --- a/packages/plugin-compiler/src/test/resources/sample/expected/00_ValidateIrBeforeLowering.ir +++ b/packages/plugin-compiler/src/test/resources/sample/expected/00_ValidateIrBeforeLowering.ir @@ -20,13 +20,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in sample.input.Sample' BLOCK type=kotlin.Long origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Long origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:kotlin.Long visibility:private' type=kotlin.Long origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -35,7 +35,7 @@ MODULE_FRAGMENT name:
then: CALL 'public final fun realmValueToAny (realmValue: io.realm.kotlin.internal.interop.RealmValue): kotlin.Any? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=kotlin.Any? origin=null realmValue: CALL 'internal final fun getValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.interop.RealmValue origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="id" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :kotlin.Long) returnType:kotlin.Unit correspondingProperty: PROPERTY name:id visibility:public modality:FINAL [var] @@ -43,13 +43,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:kotlin.Long BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:kotlin.Long visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -58,7 +58,7 @@ MODULE_FRAGMENT name:
if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'internal final fun setValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String, value: io.realm.kotlin.internal.interop.RealmValue): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="id" value: CALL 'public final fun anyToRealmValue (value: kotlin.Any?): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=io.realm.kotlin.internal.interop.RealmValue origin=null value: GET_VAR ': kotlin.Long declared in sample.input.Sample.' type=kotlin.Long origin=null @@ -116,13 +116,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String? declared in sample.input.Sample' BLOCK type=kotlin.String? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.String? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:stringField type:kotlin.String? visibility:private' type=kotlin.String? origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -131,7 +131,7 @@ MODULE_FRAGMENT name:
then: CALL 'public final fun realmValueToAny (realmValue: io.realm.kotlin.internal.interop.RealmValue): kotlin.Any? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=kotlin.Any? origin=null realmValue: CALL 'internal final fun getValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.interop.RealmValue origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="stringField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :kotlin.String?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:stringField visibility:public modality:FINAL [var] @@ -139,13 +139,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:kotlin.String? BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:stringField type:kotlin.String? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -154,7 +154,7 @@ MODULE_FRAGMENT name:
if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'internal final fun setValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String, value: io.realm.kotlin.internal.interop.RealmValue): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="stringField" value: CALL 'public final fun anyToRealmValue (value: kotlin.Any?): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=io.realm.kotlin.internal.interop.RealmValue origin=null value: GET_VAR ': kotlin.String? declared in sample.input.Sample.' type=kotlin.String? origin=null @@ -168,13 +168,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Byte? declared in sample.input.Sample' BLOCK type=kotlin.Byte? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Byte? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:byteField type:kotlin.Byte? visibility:private' type=kotlin.Byte? origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -184,7 +184,7 @@ MODULE_FRAGMENT name:
value: CALL 'public final fun realmValueToAny (realmValue: io.realm.kotlin.internal.interop.RealmValue): kotlin.Any? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=kotlin.Any? origin=null realmValue: CALL 'internal final fun getValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.interop.RealmValue origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="byteField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :kotlin.Byte?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:byteField visibility:public modality:FINAL [var] @@ -192,13 +192,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:kotlin.Byte? BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:byteField type:kotlin.Byte? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -207,7 +207,7 @@ MODULE_FRAGMENT name:
if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'internal final fun setValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String, value: io.realm.kotlin.internal.interop.RealmValue): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="byteField" value: CALL 'public final fun anyToRealmValue (value: kotlin.Any?): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=io.realm.kotlin.internal.interop.RealmValue origin=null value: CALL 'public final fun byteToLong (value: kotlin.Byte?): kotlin.Long? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=kotlin.Long? origin=null @@ -222,13 +222,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Char? declared in sample.input.Sample' BLOCK type=kotlin.Char? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Char? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:charField type:kotlin.Char? visibility:private' type=kotlin.Char? origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -238,7 +238,7 @@ MODULE_FRAGMENT name:
value: CALL 'public final fun realmValueToAny (realmValue: io.realm.kotlin.internal.interop.RealmValue): kotlin.Any? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=kotlin.Any? origin=null realmValue: CALL 'internal final fun getValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.interop.RealmValue origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="charField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :kotlin.Char?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:charField visibility:public modality:FINAL [var] @@ -246,13 +246,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:kotlin.Char? BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:charField type:kotlin.Char? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -261,7 +261,7 @@ MODULE_FRAGMENT name:
if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'internal final fun setValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String, value: io.realm.kotlin.internal.interop.RealmValue): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="charField" value: CALL 'public final fun anyToRealmValue (value: kotlin.Any?): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=io.realm.kotlin.internal.interop.RealmValue origin=null value: CALL 'public final fun charToLong (value: kotlin.Char?): kotlin.Long? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=kotlin.Long? origin=null @@ -276,13 +276,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Short? declared in sample.input.Sample' BLOCK type=kotlin.Short? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Short? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:shortField type:kotlin.Short? visibility:private' type=kotlin.Short? origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -292,7 +292,7 @@ MODULE_FRAGMENT name:
value: CALL 'public final fun realmValueToAny (realmValue: io.realm.kotlin.internal.interop.RealmValue): kotlin.Any? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=kotlin.Any? origin=null realmValue: CALL 'internal final fun getValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.interop.RealmValue origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="shortField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :kotlin.Short?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:shortField visibility:public modality:FINAL [var] @@ -300,13 +300,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:kotlin.Short? BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:shortField type:kotlin.Short? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -315,7 +315,7 @@ MODULE_FRAGMENT name:
if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'internal final fun setValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String, value: io.realm.kotlin.internal.interop.RealmValue): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="shortField" value: CALL 'public final fun anyToRealmValue (value: kotlin.Any?): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=io.realm.kotlin.internal.interop.RealmValue origin=null value: CALL 'public final fun shortToLong (value: kotlin.Short?): kotlin.Long? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=kotlin.Long? origin=null @@ -332,13 +332,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int? declared in sample.input.Sample' BLOCK type=kotlin.Int? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Int? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:intField type:kotlin.Int? visibility:private' type=kotlin.Int? origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -348,7 +348,7 @@ MODULE_FRAGMENT name:
value: CALL 'public final fun realmValueToAny (realmValue: io.realm.kotlin.internal.interop.RealmValue): kotlin.Any? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=kotlin.Any? origin=null realmValue: CALL 'internal final fun getValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.interop.RealmValue origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="intField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :kotlin.Int?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:intField visibility:public modality:FINAL [var] @@ -356,13 +356,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:kotlin.Int? BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:intField type:kotlin.Int? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -371,7 +371,7 @@ MODULE_FRAGMENT name:
if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'internal final fun setValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String, value: io.realm.kotlin.internal.interop.RealmValue): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="intField" value: CALL 'public final fun anyToRealmValue (value: kotlin.Any?): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=io.realm.kotlin.internal.interop.RealmValue origin=null value: CALL 'public final fun intToLong (value: kotlin.Int?): kotlin.Long? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=kotlin.Long? origin=null @@ -386,13 +386,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long? declared in sample.input.Sample' BLOCK type=kotlin.Long? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Long? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:longField type:kotlin.Long? visibility:private' type=kotlin.Long? origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -401,7 +401,7 @@ MODULE_FRAGMENT name:
then: CALL 'public final fun realmValueToAny (realmValue: io.realm.kotlin.internal.interop.RealmValue): kotlin.Any? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=kotlin.Any? origin=null realmValue: CALL 'internal final fun getValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.interop.RealmValue origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="longField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :kotlin.Long?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:longField visibility:public modality:FINAL [var] @@ -409,13 +409,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:kotlin.Long? BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:longField type:kotlin.Long? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -424,7 +424,7 @@ MODULE_FRAGMENT name:
if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'internal final fun setValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String, value: io.realm.kotlin.internal.interop.RealmValue): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="longField" value: CALL 'public final fun anyToRealmValue (value: kotlin.Any?): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=io.realm.kotlin.internal.interop.RealmValue origin=null value: GET_VAR ': kotlin.Long? declared in sample.input.Sample.' type=kotlin.Long? origin=null @@ -438,13 +438,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Boolean? declared in sample.input.Sample' BLOCK type=kotlin.Boolean? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Boolean? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:booleanField type:kotlin.Boolean? visibility:private' type=kotlin.Boolean? origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -453,7 +453,7 @@ MODULE_FRAGMENT name:
then: CALL 'public final fun realmValueToAny (realmValue: io.realm.kotlin.internal.interop.RealmValue): kotlin.Any? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=kotlin.Any? origin=null realmValue: CALL 'internal final fun getValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.interop.RealmValue origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="booleanField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :kotlin.Boolean?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:booleanField visibility:public modality:FINAL [var] @@ -461,13 +461,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:kotlin.Boolean? BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:booleanField type:kotlin.Boolean? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -476,7 +476,7 @@ MODULE_FRAGMENT name:
if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'internal final fun setValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String, value: io.realm.kotlin.internal.interop.RealmValue): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="booleanField" value: CALL 'public final fun anyToRealmValue (value: kotlin.Any?): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=io.realm.kotlin.internal.interop.RealmValue origin=null value: GET_VAR ': kotlin.Boolean? declared in sample.input.Sample.' type=kotlin.Boolean? origin=null @@ -490,13 +490,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Float? declared in sample.input.Sample' BLOCK type=kotlin.Float? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Float? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:floatField type:kotlin.Float? visibility:private' type=kotlin.Float? origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -505,7 +505,7 @@ MODULE_FRAGMENT name:
then: CALL 'public final fun realmValueToAny (realmValue: io.realm.kotlin.internal.interop.RealmValue): kotlin.Any? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=kotlin.Any? origin=null realmValue: CALL 'internal final fun getValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.interop.RealmValue origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="floatField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :kotlin.Float?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:floatField visibility:public modality:FINAL [var] @@ -513,13 +513,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:kotlin.Float? BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:floatField type:kotlin.Float? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -528,7 +528,7 @@ MODULE_FRAGMENT name:
if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'internal final fun setValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String, value: io.realm.kotlin.internal.interop.RealmValue): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="floatField" value: CALL 'public final fun anyToRealmValue (value: kotlin.Any?): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=io.realm.kotlin.internal.interop.RealmValue origin=null value: GET_VAR ': kotlin.Float? declared in sample.input.Sample.' type=kotlin.Float? origin=null @@ -542,13 +542,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Double? declared in sample.input.Sample' BLOCK type=kotlin.Double? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Double? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:doubleField type:kotlin.Double? visibility:private' type=kotlin.Double? origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -557,7 +557,7 @@ MODULE_FRAGMENT name:
then: CALL 'public final fun realmValueToAny (realmValue: io.realm.kotlin.internal.interop.RealmValue): kotlin.Any? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=kotlin.Any? origin=null realmValue: CALL 'internal final fun getValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.interop.RealmValue origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="doubleField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :kotlin.Double?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:doubleField visibility:public modality:FINAL [var] @@ -565,13 +565,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:kotlin.Double? BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:doubleField type:kotlin.Double? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -580,7 +580,7 @@ MODULE_FRAGMENT name:
if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'internal final fun setValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String, value: io.realm.kotlin.internal.interop.RealmValue): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="doubleField" value: CALL 'public final fun anyToRealmValue (value: kotlin.Any?): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=io.realm.kotlin.internal.interop.RealmValue origin=null value: GET_VAR ': kotlin.Double? declared in sample.input.Sample.' type=kotlin.Double? origin=null @@ -597,13 +597,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmInstant? declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmInstant? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmInstant? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:timestampField type:io.realm.kotlin.types.RealmInstant? visibility:private' type=io.realm.kotlin.types.RealmInstant? origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -612,7 +612,7 @@ MODULE_FRAGMENT name:
then: CALL 'public final fun realmValueToRealmInstant (realmValue: io.realm.kotlin.internal.interop.RealmValue): io.realm.kotlin.types.RealmInstant? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=io.realm.kotlin.types.RealmInstant? origin=null realmValue: CALL 'internal final fun getValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.interop.RealmValue origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="timestampField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmInstant?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:timestampField visibility:public modality:FINAL [var] @@ -620,13 +620,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmInstant? BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:timestampField type:io.realm.kotlin.types.RealmInstant? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -635,7 +635,7 @@ MODULE_FRAGMENT name:
if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'internal final fun setValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String, value: io.realm.kotlin.internal.interop.RealmValue): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="timestampField" value: CALL 'public final fun anyToRealmValue (value: kotlin.Any?): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=io.realm.kotlin.internal.interop.RealmValue origin=null value: GET_VAR ': io.realm.kotlin.types.RealmInstant? declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmInstant? origin=null @@ -650,13 +650,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.ObjectId? declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.ObjectId? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.ObjectId? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:objectIdField type:io.realm.kotlin.types.ObjectId? visibility:private' type=io.realm.kotlin.types.ObjectId? origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -665,7 +665,7 @@ MODULE_FRAGMENT name:
then: CALL 'public final fun realmValueToObjectId (realmValue: io.realm.kotlin.internal.interop.RealmValue): io.realm.kotlin.types.ObjectId? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=io.realm.kotlin.types.ObjectId? origin=null realmValue: CALL 'internal final fun getValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.interop.RealmValue origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="objectIdField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.ObjectId?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:objectIdField visibility:public modality:FINAL [var] @@ -673,13 +673,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.ObjectId? BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:objectIdField type:io.realm.kotlin.types.ObjectId? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -688,10 +688,115 @@ MODULE_FRAGMENT name:
if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'internal final fun setValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String, value: io.realm.kotlin.internal.interop.RealmValue): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="objectIdField" value: CALL 'public final fun anyToRealmValue (value: kotlin.Any?): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=io.realm.kotlin.internal.interop.RealmValue origin=null value: GET_VAR ': io.realm.kotlin.types.ObjectId? declared in sample.input.Sample.' type=io.realm.kotlin.types.ObjectId? origin=null + PROPERTY name:uuidField visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:uuidField type:io.realm.kotlin.types.RealmUUID? visibility:private + EXPRESSION_BODY + CALL 'public final fun random (): io.realm.kotlin.types.RealmUUID declared in io.realm.kotlin.types.RealmUUID.Companion' type=io.realm.kotlin.types.RealmUUID origin=null + $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=io.realm.kotlin.types.RealmUUID.Companion + FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample) returnType:io.realm.kotlin.types.RealmUUID? + correspondingProperty: PROPERTY name:uuidField visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:sample.input.Sample + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmUUID? declared in sample.input.Sample' + BLOCK type=io.realm.kotlin.types.RealmUUID? origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + WHEN type=io.realm.kotlin.types.RealmUUID? origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:uuidField type:io.realm.kotlin.types.RealmUUID? visibility:private' type=io.realm.kotlin.types.RealmUUID? origin=null + receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun realmValueToRealmUUID (realmValue: io.realm.kotlin.internal.interop.RealmValue): io.realm.kotlin.types.RealmUUID? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=io.realm.kotlin.types.RealmUUID? origin=null + realmValue: CALL 'internal final fun getValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.interop.RealmValue origin=GET_PROPERTY + $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + propertyName: CONST String type=kotlin.String value="uuidField" + FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmUUID?) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:uuidField visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:sample.input.Sample + VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmUUID? + BLOCK_BODY + BLOCK type=kotlin.Unit origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:uuidField type:io.realm.kotlin.types.RealmUUID? visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + value: GET_VAR ': io.realm.kotlin.types.RealmUUID? declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmUUID? origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'internal final fun setValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String, value: io.realm.kotlin.internal.interop.RealmValue): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY + $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + propertyName: CONST String type=kotlin.String value="uuidField" + value: CALL 'public final fun anyToRealmValue (value: kotlin.Any?): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=io.realm.kotlin.internal.interop.RealmValue origin=null + value: GET_VAR ': io.realm.kotlin.types.RealmUUID? declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmUUID? origin=null + PROPERTY name:byteArrayField visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:byteArrayField type:kotlin.ByteArray? visibility:private + EXPRESSION_BODY + CONST Null type=kotlin.Nothing? value=null + FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample) returnType:kotlin.ByteArray? + correspondingProperty: PROPERTY name:byteArrayField visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:sample.input.Sample + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.ByteArray? declared in sample.input.Sample' + BLOCK type=kotlin.ByteArray? origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + WHEN type=kotlin.ByteArray? origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:byteArrayField type:kotlin.ByteArray? visibility:private' type=kotlin.ByteArray? origin=null + receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun realmValueToAny (realmValue: io.realm.kotlin.internal.interop.RealmValue): kotlin.Any? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=kotlin.Any? origin=null + realmValue: CALL 'internal final fun getValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.interop.RealmValue origin=GET_PROPERTY + $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + propertyName: CONST String type=kotlin.String value="byteArrayField" + FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :kotlin.ByteArray?) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:byteArrayField visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:sample.input.Sample + VALUE_PARAMETER name: index:0 type:kotlin.ByteArray? + BLOCK_BODY + BLOCK type=kotlin.Unit origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:byteArrayField type:kotlin.ByteArray? visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + value: GET_VAR ': kotlin.ByteArray? declared in sample.input.Sample.' type=kotlin.ByteArray? origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'internal final fun setValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String, value: io.realm.kotlin.internal.interop.RealmValue): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY + $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + propertyName: CONST String type=kotlin.String value="byteArrayField" + value: CALL 'public final fun anyToRealmValue (value: kotlin.Any?): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=io.realm.kotlin.internal.interop.RealmValue origin=null + value: GET_VAR ': kotlin.ByteArray? declared in sample.input.Sample.' type=kotlin.ByteArray? origin=null PROPERTY name:child visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:child type:sample.input.Child? visibility:private EXPRESSION_BODY @@ -702,13 +807,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): sample.input.Child? declared in sample.input.Sample' BLOCK type=sample.input.Child? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=sample.input.Child? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:child type:sample.input.Child? visibility:private' type=sample.input.Child? origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -718,7 +823,7 @@ MODULE_FRAGMENT name:
: sample.input.Child? : $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="child" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :sample.input.Child?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:child visibility:public modality:FINAL [var] @@ -726,13 +831,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:sample.input.Child? BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:child type:sample.input.Child? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -741,7 +846,7 @@ MODULE_FRAGMENT name:
if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'internal final fun setObject (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String, value: io.realm.kotlin.types.BaseRealmObject?, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="child" value: GET_VAR ': sample.input.Child? declared in sample.input.Sample.' type=sample.input.Child? origin=null PROPERTY name:stringListField visibility:public modality:FINAL [var] @@ -755,13 +860,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:stringListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -770,7 +875,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : kotlin.String $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="stringListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:stringListField visibility:public modality:FINAL [var] @@ -778,13 +883,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:stringListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -794,7 +899,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : kotlin.String $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="stringListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:byteListField visibility:public modality:FINAL [var] @@ -808,13 +913,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:byteListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -823,7 +928,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : kotlin.Byte $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="byteListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:byteListField visibility:public modality:FINAL [var] @@ -831,13 +936,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:byteListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -847,7 +952,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : kotlin.Byte $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="byteListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:charListField visibility:public modality:FINAL [var] @@ -861,13 +966,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:charListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -876,7 +981,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : kotlin.Char $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="charListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:charListField visibility:public modality:FINAL [var] @@ -884,13 +989,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:charListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -900,7 +1005,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : kotlin.Char $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="charListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:shortListField visibility:public modality:FINAL [var] @@ -914,13 +1019,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:shortListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -929,7 +1034,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : kotlin.Short $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="shortListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:shortListField visibility:public modality:FINAL [var] @@ -937,13 +1042,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:shortListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -953,7 +1058,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : kotlin.Short $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="shortListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:intListField visibility:public modality:FINAL [var] @@ -967,13 +1072,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:intListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -982,7 +1087,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : kotlin.Int $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="intListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:intListField visibility:public modality:FINAL [var] @@ -990,13 +1095,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:intListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1006,7 +1111,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : kotlin.Int $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="intListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:longListField visibility:public modality:FINAL [var] @@ -1020,13 +1125,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:longListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1035,7 +1140,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : kotlin.Long $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="longListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:longListField visibility:public modality:FINAL [var] @@ -1043,13 +1148,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:longListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1059,7 +1164,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : kotlin.Long $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="longListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:booleanListField visibility:public modality:FINAL [var] @@ -1073,13 +1178,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:booleanListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1088,7 +1193,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : kotlin.Boolean $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="booleanListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:booleanListField visibility:public modality:FINAL [var] @@ -1096,13 +1201,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:booleanListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1112,7 +1217,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : kotlin.Boolean $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="booleanListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:floatListField visibility:public modality:FINAL [var] @@ -1126,13 +1231,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:floatListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1141,7 +1246,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : kotlin.Float $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="floatListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:floatListField visibility:public modality:FINAL [var] @@ -1149,13 +1254,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:floatListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1165,7 +1270,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : kotlin.Float $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="floatListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:doubleListField visibility:public modality:FINAL [var] @@ -1179,13 +1284,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:doubleListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1194,7 +1299,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : kotlin.Double $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="doubleListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:doubleListField visibility:public modality:FINAL [var] @@ -1202,13 +1307,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:doubleListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1218,7 +1323,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : kotlin.Double $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="doubleListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:timestampListField visibility:public modality:FINAL [var] @@ -1232,13 +1337,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:timestampListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1247,7 +1352,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : io.realm.kotlin.types.RealmInstant $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="timestampListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:timestampListField visibility:public modality:FINAL [var] @@ -1255,13 +1360,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:timestampListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1271,7 +1376,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : io.realm.kotlin.types.RealmInstant $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="timestampListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:objectIdListField visibility:public modality:FINAL [var] @@ -1285,13 +1390,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:objectIdListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1300,7 +1405,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : io.realm.kotlin.types.ObjectId $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="objectIdListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:objectIdListField visibility:public modality:FINAL [var] @@ -1308,13 +1413,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:objectIdListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1324,9 +1429,115 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : io.realm.kotlin.types.ObjectId $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="objectIdListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null + PROPERTY name:uuidListField visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:uuidListField type:io.realm.kotlin.types.RealmList visibility:private + EXPRESSION_BODY + CALL 'public final fun realmListOf (vararg elements: T of io.realm.kotlin.ext.RealmListExtKt.realmListOf): io.realm.kotlin.types.RealmList declared in io.realm.kotlin.ext.RealmListExtKt' type=io.realm.kotlin.types.RealmList origin=null + : io.realm.kotlin.types.RealmUUID + FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample) returnType:io.realm.kotlin.types.RealmList + correspondingProperty: PROPERTY name:uuidListField visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:sample.input.Sample + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' + BLOCK type=io.realm.kotlin.types.RealmList origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + WHEN type=io.realm.kotlin.types.RealmList origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:uuidListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null + receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY + : io.realm.kotlin.types.RealmUUID + $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + propertyName: CONST String type=kotlin.String value="uuidListField" + FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:uuidListField visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:sample.input.Sample + VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList + BLOCK_BODY + BLOCK type=kotlin.Unit origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:uuidListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + value: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY + : io.realm.kotlin.types.RealmUUID + $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + col: CONST String type=kotlin.String value="uuidListField" + list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null + PROPERTY name:binaryListField visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:binaryListField type:io.realm.kotlin.types.RealmList visibility:private + EXPRESSION_BODY + CALL 'public final fun realmListOf (vararg elements: T of io.realm.kotlin.ext.RealmListExtKt.realmListOf): io.realm.kotlin.types.RealmList declared in io.realm.kotlin.ext.RealmListExtKt' type=io.realm.kotlin.types.RealmList origin=null + : kotlin.ByteArray + FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample) returnType:io.realm.kotlin.types.RealmList + correspondingProperty: PROPERTY name:binaryListField visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:sample.input.Sample + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' + BLOCK type=io.realm.kotlin.types.RealmList origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + WHEN type=io.realm.kotlin.types.RealmList origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:binaryListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null + receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY + : kotlin.ByteArray + $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + propertyName: CONST String type=kotlin.String value="binaryListField" + FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:binaryListField visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:sample.input.Sample + VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList + BLOCK_BODY + BLOCK type=kotlin.Unit origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:binaryListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + value: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY + : kotlin.ByteArray + $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + col: CONST String type=kotlin.String value="binaryListField" + list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:objectListField visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:objectListField type:io.realm.kotlin.types.RealmList visibility:private EXPRESSION_BODY @@ -1338,13 +1549,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:objectListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1353,7 +1564,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : sample.input.Sample $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="objectListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:objectListField visibility:public modality:FINAL [var] @@ -1361,13 +1572,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:objectListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1377,7 +1588,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : sample.input.Sample $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="objectListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:embeddedRealmObjectListField visibility:public modality:FINAL [var] @@ -1391,13 +1602,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:embeddedRealmObjectListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1406,7 +1617,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : sample.input.EmbeddedChild $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="embeddedRealmObjectListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:embeddedRealmObjectListField visibility:public modality:FINAL [var] @@ -1414,13 +1625,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:embeddedRealmObjectListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1430,7 +1641,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : sample.input.EmbeddedChild $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="embeddedRealmObjectListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:nullableStringListField visibility:public modality:FINAL [var] @@ -1444,13 +1655,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableStringListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1459,7 +1670,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : kotlin.String? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="nullableStringListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:nullableStringListField visibility:public modality:FINAL [var] @@ -1467,13 +1678,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableStringListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1483,7 +1694,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : kotlin.String? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="nullableStringListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:nullableByteListField visibility:public modality:FINAL [var] @@ -1497,13 +1708,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableByteListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1512,7 +1723,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : kotlin.Byte? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="nullableByteListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:nullableByteListField visibility:public modality:FINAL [var] @@ -1520,13 +1731,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableByteListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1536,7 +1747,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : kotlin.Byte? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="nullableByteListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:nullableCharListField visibility:public modality:FINAL [var] @@ -1550,13 +1761,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableCharListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1565,7 +1776,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : kotlin.Char? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="nullableCharListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:nullableCharListField visibility:public modality:FINAL [var] @@ -1573,13 +1784,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableCharListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1589,7 +1800,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : kotlin.Char? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="nullableCharListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:nullableShortListField visibility:public modality:FINAL [var] @@ -1603,13 +1814,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableShortListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1618,7 +1829,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : kotlin.Short? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="nullableShortListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:nullableShortListField visibility:public modality:FINAL [var] @@ -1626,13 +1837,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableShortListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1642,7 +1853,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : kotlin.Short? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="nullableShortListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:nullableIntListField visibility:public modality:FINAL [var] @@ -1656,13 +1867,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableIntListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1671,7 +1882,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : kotlin.Int? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="nullableIntListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:nullableIntListField visibility:public modality:FINAL [var] @@ -1679,13 +1890,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableIntListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1695,7 +1906,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : kotlin.Int? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="nullableIntListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:nullableLongListField visibility:public modality:FINAL [var] @@ -1709,13 +1920,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableLongListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1724,7 +1935,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : kotlin.Long? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="nullableLongListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:nullableLongListField visibility:public modality:FINAL [var] @@ -1732,13 +1943,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableLongListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1748,7 +1959,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : kotlin.Long? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="nullableLongListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:nullableBooleanListField visibility:public modality:FINAL [var] @@ -1762,13 +1973,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableBooleanListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1777,7 +1988,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : kotlin.Boolean? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="nullableBooleanListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:nullableBooleanListField visibility:public modality:FINAL [var] @@ -1785,13 +1996,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableBooleanListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1801,7 +2012,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : kotlin.Boolean? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="nullableBooleanListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:nullableFloatListField visibility:public modality:FINAL [var] @@ -1815,13 +2026,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableFloatListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1830,7 +2041,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : kotlin.Float? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="nullableFloatListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:nullableFloatListField visibility:public modality:FINAL [var] @@ -1838,13 +2049,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableFloatListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1854,7 +2065,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : kotlin.Float? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="nullableFloatListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:nullableDoubleListField visibility:public modality:FINAL [var] @@ -1868,13 +2079,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableDoubleListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1883,7 +2094,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : kotlin.Double? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="nullableDoubleListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:nullableDoubleListField visibility:public modality:FINAL [var] @@ -1891,13 +2102,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableDoubleListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1907,7 +2118,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : kotlin.Double? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="nullableDoubleListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:nullableTimestampListField visibility:public modality:FINAL [var] @@ -1921,13 +2132,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableTimestampListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1936,7 +2147,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : io.realm.kotlin.types.RealmInstant? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="nullableTimestampListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:nullableTimestampListField visibility:public modality:FINAL [var] @@ -1944,13 +2155,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableTimestampListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1960,7 +2171,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : io.realm.kotlin.types.RealmInstant? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="nullableTimestampListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null PROPERTY name:nullableObjectIdListField visibility:public modality:FINAL [var] @@ -1974,13 +2185,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' BLOCK type=io.realm.kotlin.types.RealmList origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=io.realm.kotlin.types.RealmList origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableObjectIdListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -1989,7 +2200,7 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY : io.realm.kotlin.types.ObjectId? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="nullableObjectIdListField" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit correspondingProperty: PROPERTY name:nullableObjectIdListField visibility:public modality:FINAL [var] @@ -1997,13 +2208,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableObjectIdListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null @@ -2013,9 +2224,115 @@ MODULE_FRAGMENT name:
then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY : io.realm.kotlin.types.ObjectId? $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null col: CONST String type=kotlin.String value="nullableObjectIdListField" list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null + PROPERTY name:nullableUUIDListField visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:nullableUUIDListField type:io.realm.kotlin.types.RealmList visibility:private + EXPRESSION_BODY + CALL 'public final fun realmListOf (vararg elements: T of io.realm.kotlin.ext.RealmListExtKt.realmListOf): io.realm.kotlin.types.RealmList declared in io.realm.kotlin.ext.RealmListExtKt' type=io.realm.kotlin.types.RealmList origin=null + : io.realm.kotlin.types.RealmUUID? + FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample) returnType:io.realm.kotlin.types.RealmList + correspondingProperty: PROPERTY name:nullableUUIDListField visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:sample.input.Sample + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' + BLOCK type=io.realm.kotlin.types.RealmList origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + WHEN type=io.realm.kotlin.types.RealmList origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableUUIDListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null + receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY + : io.realm.kotlin.types.RealmUUID? + $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + propertyName: CONST String type=kotlin.String value="nullableUUIDListField" + FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:nullableUUIDListField visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:sample.input.Sample + VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList + BLOCK_BODY + BLOCK type=kotlin.Unit origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableUUIDListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + value: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY + : io.realm.kotlin.types.RealmUUID? + $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + col: CONST String type=kotlin.String value="nullableUUIDListField" + list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null + PROPERTY name:nullableBinaryListField visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:nullableBinaryListField type:io.realm.kotlin.types.RealmList visibility:private + EXPRESSION_BODY + CALL 'public final fun realmListOf (vararg elements: T of io.realm.kotlin.ext.RealmListExtKt.realmListOf): io.realm.kotlin.types.RealmList declared in io.realm.kotlin.ext.RealmListExtKt' type=io.realm.kotlin.types.RealmList origin=null + : kotlin.ByteArray? + FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample) returnType:io.realm.kotlin.types.RealmList + correspondingProperty: PROPERTY name:nullableBinaryListField visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:sample.input.Sample + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' + BLOCK type=io.realm.kotlin.types.RealmList origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + WHEN type=io.realm.kotlin.types.RealmList origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableBinaryListField type:io.realm.kotlin.types.RealmList visibility:private' type=io.realm.kotlin.types.RealmList origin=null + receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'internal final fun getList (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.ManagedRealmList [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.ManagedRealmList origin=GET_PROPERTY + : kotlin.ByteArray? + $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + propertyName: CONST String type=kotlin.String value="nullableBinaryListField" + FUN name: visibility:public modality:FINAL <> ($this:sample.input.Sample, :io.realm.kotlin.types.RealmList) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:nullableBinaryListField visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:sample.input.Sample + VALUE_PARAMETER name: index:0 type:io.realm.kotlin.types.RealmList + BLOCK_BODY + BLOCK type=kotlin.Unit origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + $this: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nullableBinaryListField type:io.realm.kotlin.types.RealmList visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null + value: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'internal final fun setList (obj: io.realm.kotlin.internal.RealmObjectReference, col: kotlin.String, list: io.realm.kotlin.types.RealmList, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY + : kotlin.ByteArray? + $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + col: CONST String type=kotlin.String value="nullableBinaryListField" + list: GET_VAR ': io.realm.kotlin.types.RealmList declared in sample.input.Sample.' type=io.realm.kotlin.types.RealmList origin=null FUN name:dumpSchema visibility:public modality:FINAL <> ($this:sample.input.Sample) returnType:kotlin.String $this: VALUE_PARAMETER name: type:sample.input.Sample BLOCK_BODY @@ -2053,7 +2370,7 @@ MODULE_FRAGMENT name:
$this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.interop.ClassInfo.Companion name: CONST String type=kotlin.String value="Sample" primaryKey: CONST String type=kotlin.String value="id" - numProperties: CONST Long type=kotlin.Long value=37 + numProperties: CONST Long type=kotlin.Long value=43 isEmbedded: CONST Boolean type=kotlin.Boolean value=false cinteropProperties: CALL 'public final fun listOf (vararg elements: T of kotlin.collections.CollectionsKt.listOf): kotlin.collections.List declared in kotlin.collections.CollectionsKt' type=kotlin.collections.List origin=null : io.realm.kotlin.internal.interop.PropertyInfo @@ -2190,6 +2507,28 @@ MODULE_FRAGMENT name:
isNullable: CONST Boolean type=kotlin.Boolean value=true isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false isIndexed: CONST Boolean type=kotlin.Boolean value=false + CALL 'public final fun create (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.String?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.interop.PropertyInfo.Companion' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null + $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.interop.PropertyInfo.Companion + name: CONST String type=kotlin.String value="uuidField" + publicName: CONST String type=kotlin.String value="" + type: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_PROPERTY_TYPE_UUID' type=io.realm.kotlin.internal.interop.PropertyType + collectionType: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_COLLECTION_TYPE_NONE' type=io.realm.kotlin.internal.interop.CollectionType + linkTarget: CONST String type=kotlin.String value="" + linkOriginPropertyName: CONST String type=kotlin.String value="" + isNullable: CONST Boolean type=kotlin.Boolean value=true + isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false + isIndexed: CONST Boolean type=kotlin.Boolean value=false + CALL 'public final fun create (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.String?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.interop.PropertyInfo.Companion' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null + $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.interop.PropertyInfo.Companion + name: CONST String type=kotlin.String value="byteArrayField" + publicName: CONST String type=kotlin.String value="" + type: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_PROPERTY_TYPE_BINARY' type=io.realm.kotlin.internal.interop.PropertyType + collectionType: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_COLLECTION_TYPE_NONE' type=io.realm.kotlin.internal.interop.CollectionType + linkTarget: CONST String type=kotlin.String value="" + linkOriginPropertyName: CONST String type=kotlin.String value="" + isNullable: CONST Boolean type=kotlin.Boolean value=true + isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false + isIndexed: CONST Boolean type=kotlin.Boolean value=false CALL 'public final fun create (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.String?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.interop.PropertyInfo.Companion' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.interop.PropertyInfo.Companion name: CONST String type=kotlin.String value="child" @@ -2322,6 +2661,28 @@ MODULE_FRAGMENT name:
isNullable: CONST Boolean type=kotlin.Boolean value=false isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false isIndexed: CONST Boolean type=kotlin.Boolean value=false + CALL 'public final fun create (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.String?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.interop.PropertyInfo.Companion' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null + $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.interop.PropertyInfo.Companion + name: CONST String type=kotlin.String value="uuidListField" + publicName: CONST String type=kotlin.String value="" + type: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_PROPERTY_TYPE_UUID' type=io.realm.kotlin.internal.interop.PropertyType + collectionType: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_COLLECTION_TYPE_LIST' type=io.realm.kotlin.internal.interop.CollectionType + linkTarget: CONST String type=kotlin.String value="" + linkOriginPropertyName: CONST String type=kotlin.String value="" + isNullable: CONST Boolean type=kotlin.Boolean value=false + isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false + isIndexed: CONST Boolean type=kotlin.Boolean value=false + CALL 'public final fun create (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.String?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.interop.PropertyInfo.Companion' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null + $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.interop.PropertyInfo.Companion + name: CONST String type=kotlin.String value="binaryListField" + publicName: CONST String type=kotlin.String value="" + type: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_PROPERTY_TYPE_BINARY' type=io.realm.kotlin.internal.interop.PropertyType + collectionType: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_COLLECTION_TYPE_LIST' type=io.realm.kotlin.internal.interop.CollectionType + linkTarget: CONST String type=kotlin.String value="" + linkOriginPropertyName: CONST String type=kotlin.String value="" + isNullable: CONST Boolean type=kotlin.Boolean value=false + isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false + isIndexed: CONST Boolean type=kotlin.Boolean value=false CALL 'public final fun create (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.String?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.interop.PropertyInfo.Companion' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.interop.PropertyInfo.Companion name: CONST String type=kotlin.String value="objectListField" @@ -2465,6 +2826,28 @@ MODULE_FRAGMENT name:
isNullable: CONST Boolean type=kotlin.Boolean value=true isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false isIndexed: CONST Boolean type=kotlin.Boolean value=false + CALL 'public final fun create (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.String?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.interop.PropertyInfo.Companion' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null + $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.interop.PropertyInfo.Companion + name: CONST String type=kotlin.String value="nullableUUIDListField" + publicName: CONST String type=kotlin.String value="" + type: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_PROPERTY_TYPE_UUID' type=io.realm.kotlin.internal.interop.PropertyType + collectionType: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_COLLECTION_TYPE_LIST' type=io.realm.kotlin.internal.interop.CollectionType + linkTarget: CONST String type=kotlin.String value="" + linkOriginPropertyName: CONST String type=kotlin.String value="" + isNullable: CONST Boolean type=kotlin.Boolean value=true + isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false + isIndexed: CONST Boolean type=kotlin.Boolean value=false + CALL 'public final fun create (name: kotlin.String, publicName: kotlin.String?, type: io.realm.kotlin.internal.interop.PropertyType, collectionType: io.realm.kotlin.internal.interop.CollectionType, linkTarget: kotlin.String?, linkOriginPropertyName: kotlin.String?, isNullable: kotlin.Boolean, isPrimaryKey: kotlin.Boolean, isIndexed: kotlin.Boolean): io.realm.kotlin.internal.interop.PropertyInfo declared in io.realm.kotlin.internal.interop.PropertyInfo.Companion' type=io.realm.kotlin.internal.interop.PropertyInfo origin=null + $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.interop.PropertyInfo.Companion + name: CONST String type=kotlin.String value="nullableBinaryListField" + publicName: CONST String type=kotlin.String value="" + type: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_PROPERTY_TYPE_BINARY' type=io.realm.kotlin.internal.interop.PropertyType + collectionType: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:RLM_COLLECTION_TYPE_LIST' type=io.realm.kotlin.internal.interop.CollectionType + linkTarget: CONST String type=kotlin.String value="" + linkOriginPropertyName: CONST String type=kotlin.String value="" + isNullable: CONST Boolean type=kotlin.Boolean value=true + isPrimaryKey: CONST Boolean type=kotlin.Boolean value=false + isIndexed: CONST Boolean type=kotlin.Boolean value=false FUN name:io_realm_kotlin_newInstance visibility:public modality:OPEN <> ($this:sample.input.Sample.Companion) returnType:kotlin.Any overridden: public abstract fun io_realm_kotlin_newInstance (): kotlin.Any declared in io.realm.kotlin.internal.RealmObjectCompanion @@ -2552,6 +2935,16 @@ MODULE_FRAGMENT name:
: kotlin.reflect.KMutableProperty1 first: CONST String type=kotlin.String value="objectIdField" second: PROPERTY_REFERENCE 'public final objectIdField: io.realm.kotlin.types.ObjectId? [var]' field=null getter='public final fun (): io.realm.kotlin.types.ObjectId? declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.ObjectId?): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null + CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null + : kotlin.String + : kotlin.reflect.KMutableProperty1 + first: CONST String type=kotlin.String value="uuidField" + second: PROPERTY_REFERENCE 'public final uuidField: io.realm.kotlin.types.RealmUUID? [var]' field=null getter='public final fun (): io.realm.kotlin.types.RealmUUID? declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.RealmUUID?): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null + CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null + : kotlin.String + : kotlin.reflect.KMutableProperty1 + first: CONST String type=kotlin.String value="byteArrayField" + second: PROPERTY_REFERENCE 'public final byteArrayField: kotlin.ByteArray? [var]' field=null getter='public final fun (): kotlin.ByteArray? declared in sample.input.Sample' setter='public final fun (: kotlin.ByteArray?): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null : kotlin.String : kotlin.reflect.KMutableProperty1 @@ -2612,6 +3005,16 @@ MODULE_FRAGMENT name:
: kotlin.reflect.KMutableProperty1 first: CONST String type=kotlin.String value="objectIdListField" second: PROPERTY_REFERENCE 'public final objectIdListField: io.realm.kotlin.types.RealmList [var]' field=null getter='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.RealmList): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null + CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null + : kotlin.String + : kotlin.reflect.KMutableProperty1 + first: CONST String type=kotlin.String value="uuidListField" + second: PROPERTY_REFERENCE 'public final uuidListField: io.realm.kotlin.types.RealmList [var]' field=null getter='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.RealmList): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null + CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null + : kotlin.String + : kotlin.reflect.KMutableProperty1 + first: CONST String type=kotlin.String value="binaryListField" + second: PROPERTY_REFERENCE 'public final binaryListField: io.realm.kotlin.types.RealmList [var]' field=null getter='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.RealmList): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null : kotlin.String : kotlin.reflect.KMutableProperty1 @@ -2677,6 +3080,16 @@ MODULE_FRAGMENT name:
: kotlin.reflect.KMutableProperty1 first: CONST String type=kotlin.String value="nullableObjectIdListField" second: PROPERTY_REFERENCE 'public final nullableObjectIdListField: io.realm.kotlin.types.RealmList [var]' field=null getter='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.RealmList): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null + CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null + : kotlin.String + : kotlin.reflect.KMutableProperty1 + first: CONST String type=kotlin.String value="nullableUUIDListField" + second: PROPERTY_REFERENCE 'public final nullableUUIDListField: io.realm.kotlin.types.RealmList [var]' field=null getter='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.RealmList): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null + CONSTRUCTOR_CALL 'public constructor (first: A of kotlin.Pair, second: B of kotlin.Pair) [primary] declared in kotlin.Pair' type=kotlin.Pair> origin=null + : kotlin.String + : kotlin.reflect.KMutableProperty1 + first: CONST String type=kotlin.String value="nullableBinaryListField" + second: PROPERTY_REFERENCE 'public final nullableBinaryListField: io.realm.kotlin.types.RealmList [var]' field=null getter='public final fun (): io.realm.kotlin.types.RealmList declared in sample.input.Sample' setter='public final fun (: io.realm.kotlin.types.RealmList): kotlin.Unit declared in sample.input.Sample' type=kotlin.reflect.KMutableProperty1 origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:sample.input.Sample.Companion) returnType:kotlin.collections.Map> correspondingProperty: PROPERTY name:io_realm_kotlin_fields visibility:public modality:FINAL [var] overridden: @@ -2726,28 +3139,28 @@ MODULE_FRAGMENT name:
public open fun toString (): kotlin.String [fake_override] declared in io.realm.kotlin.types.RealmObject $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] - FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private + FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private EXPRESSION_BODY CONST Null type=kotlin.Nothing? value=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:sample.input.Sample) returnType:io.realm.kotlin.internal.RealmObjectReference? + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:sample.input.Sample) returnType:io.realm.kotlin.internal.RealmObjectReference? correspondingProperty: PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] overridden: public abstract fun (): io.realm.kotlin.internal.RealmObjectReference? declared in io.realm.kotlin.internal.RealmObjectInternal $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:sample.input.Sample BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + RETURN type=kotlin.Nothing from='public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=io.realm.kotlin.internal.RealmObjectReference? origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:sample.input.Sample, :io.realm.kotlin.internal.RealmObjectReference?) returnType:kotlin.Unit + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:sample.input.Sample, :io.realm.kotlin.internal.RealmObjectReference?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] overridden: public abstract fun (: io.realm.kotlin.internal.RealmObjectReference?): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectInternal $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:sample.input.Sample - VALUE_PARAMETER name: index:0 type:io.realm.kotlin.internal.RealmObjectReference? + VALUE_PARAMETER name: index:0 type:io.realm.kotlin.internal.RealmObjectReference? BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=kotlin.Unit origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Sample declared in sample.input.Sample.' type=sample.input.Sample origin=null - value: GET_VAR ': io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + value: GET_VAR ': io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Sample.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null CLASS CLASS name:Child modality:OPEN visibility:public superTypes:[io.realm.kotlin.types.RealmObject; io.realm.kotlin.internal.RealmObjectInternal] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:sample.input.Child CONSTRUCTOR visibility:public <> () returnType:sample.input.Child [primary] @@ -2764,13 +3177,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String? declared in sample.input.Child' BLOCK type=kotlin.String? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Child' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Child' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Child declared in sample.input.Child.' type=sample.input.Child origin=null WHEN type=kotlin.String? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Child.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Child.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String? visibility:private' type=kotlin.String? origin=null receiver: GET_VAR ': sample.input.Child declared in sample.input.Child.' type=sample.input.Child origin=null @@ -2779,7 +3192,7 @@ MODULE_FRAGMENT name:
then: CALL 'public final fun realmValueToAny (realmValue: io.realm.kotlin.internal.interop.RealmValue): kotlin.Any? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=kotlin.Any? origin=null realmValue: CALL 'internal final fun getValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.interop.RealmValue origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Child.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Child.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="name" FUN name: visibility:public modality:FINAL <> ($this:sample.input.Child, :kotlin.String?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:name visibility:public modality:FINAL [var] @@ -2787,13 +3200,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:kotlin.String? BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Child' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Child' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.Child declared in sample.input.Child.' type=sample.input.Child origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Child.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Child.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Child declared in sample.input.Child.' type=sample.input.Child origin=null @@ -2802,7 +3215,7 @@ MODULE_FRAGMENT name:
if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'internal final fun setValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String, value: io.realm.kotlin.internal.interop.RealmValue): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Child.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.Child.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="name" value: CALL 'public final fun anyToRealmValue (value: kotlin.Any?): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=io.realm.kotlin.internal.interop.RealmValue origin=null value: GET_VAR ': kotlin.String? declared in sample.input.Child.' type=kotlin.String? origin=null @@ -2933,28 +3346,28 @@ MODULE_FRAGMENT name:
public open fun toString (): kotlin.String [fake_override] declared in io.realm.kotlin.types.RealmObject $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] - FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private + FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private EXPRESSION_BODY CONST Null type=kotlin.Nothing? value=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:sample.input.Child) returnType:io.realm.kotlin.internal.RealmObjectReference? + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:sample.input.Child) returnType:io.realm.kotlin.internal.RealmObjectReference? correspondingProperty: PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] overridden: public abstract fun (): io.realm.kotlin.internal.RealmObjectReference? declared in io.realm.kotlin.internal.RealmObjectInternal $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:sample.input.Child BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Child' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + RETURN type=kotlin.Nothing from='public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Child' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=io.realm.kotlin.internal.RealmObjectReference? origin=null receiver: GET_VAR ': sample.input.Child declared in sample.input.Child.' type=sample.input.Child origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:sample.input.Child, :io.realm.kotlin.internal.RealmObjectReference?) returnType:kotlin.Unit + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:sample.input.Child, :io.realm.kotlin.internal.RealmObjectReference?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] overridden: public abstract fun (: io.realm.kotlin.internal.RealmObjectReference?): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectInternal $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:sample.input.Child - VALUE_PARAMETER name: index:0 type:io.realm.kotlin.internal.RealmObjectReference? + VALUE_PARAMETER name: index:0 type:io.realm.kotlin.internal.RealmObjectReference? BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=kotlin.Unit origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.Child declared in sample.input.Child.' type=sample.input.Child origin=null - value: GET_VAR ': io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Child.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + value: GET_VAR ': io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.Child.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null CLASS CLASS name:EmbeddedParent modality:OPEN visibility:public superTypes:[io.realm.kotlin.types.RealmObject; io.realm.kotlin.internal.RealmObjectInternal] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:sample.input.EmbeddedParent CONSTRUCTOR visibility:public <> () returnType:sample.input.EmbeddedParent [primary] @@ -2971,13 +3384,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): sample.input.EmbeddedChild? declared in sample.input.EmbeddedParent' BLOCK type=sample.input.EmbeddedChild? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.EmbeddedParent' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.EmbeddedParent' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.EmbeddedParent declared in sample.input.EmbeddedParent.' type=sample.input.EmbeddedParent origin=null WHEN type=sample.input.EmbeddedChild? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.EmbeddedParent.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.EmbeddedParent.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:child type:sample.input.EmbeddedChild? visibility:private' type=sample.input.EmbeddedChild? origin=null receiver: GET_VAR ': sample.input.EmbeddedParent declared in sample.input.EmbeddedParent.' type=sample.input.EmbeddedParent origin=null @@ -2987,7 +3400,7 @@ MODULE_FRAGMENT name:
: sample.input.EmbeddedChild? : $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.EmbeddedParent.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.EmbeddedParent.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="child" FUN name: visibility:public modality:FINAL <> ($this:sample.input.EmbeddedParent, :sample.input.EmbeddedChild?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:child visibility:public modality:FINAL [var] @@ -2995,13 +3408,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:sample.input.EmbeddedChild? BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.EmbeddedParent' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.EmbeddedParent' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.EmbeddedParent declared in sample.input.EmbeddedParent.' type=sample.input.EmbeddedParent origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.EmbeddedParent.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.EmbeddedParent.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:child type:sample.input.EmbeddedChild? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.EmbeddedParent declared in sample.input.EmbeddedParent.' type=sample.input.EmbeddedParent origin=null @@ -3010,7 +3423,7 @@ MODULE_FRAGMENT name:
if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'internal final fun setEmbeddedRealmObject (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String, value: io.realm.kotlin.types.BaseRealmObject?, updatePolicy: io.realm.kotlin.UpdatePolicy, cache: kotlin.collections.MutableMap{ io.realm.kotlin.internal.RealmUtilsKt.ObjectCache }): kotlin.Unit [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.EmbeddedParent.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.EmbeddedParent.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="child" value: GET_VAR ': sample.input.EmbeddedChild? declared in sample.input.EmbeddedParent.' type=sample.input.EmbeddedChild? origin=null CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any; io.realm.kotlin.internal.RealmObjectCompanion] @@ -3140,28 +3553,28 @@ MODULE_FRAGMENT name:
public open fun toString (): kotlin.String [fake_override] declared in io.realm.kotlin.types.RealmObject $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] - FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private + FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private EXPRESSION_BODY CONST Null type=kotlin.Nothing? value=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:sample.input.EmbeddedParent) returnType:io.realm.kotlin.internal.RealmObjectReference? + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:sample.input.EmbeddedParent) returnType:io.realm.kotlin.internal.RealmObjectReference? correspondingProperty: PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] overridden: public abstract fun (): io.realm.kotlin.internal.RealmObjectReference? declared in io.realm.kotlin.internal.RealmObjectInternal $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:sample.input.EmbeddedParent BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.EmbeddedParent' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + RETURN type=kotlin.Nothing from='public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.EmbeddedParent' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=io.realm.kotlin.internal.RealmObjectReference? origin=null receiver: GET_VAR ': sample.input.EmbeddedParent declared in sample.input.EmbeddedParent.' type=sample.input.EmbeddedParent origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:sample.input.EmbeddedParent, :io.realm.kotlin.internal.RealmObjectReference?) returnType:kotlin.Unit + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:sample.input.EmbeddedParent, :io.realm.kotlin.internal.RealmObjectReference?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] overridden: public abstract fun (: io.realm.kotlin.internal.RealmObjectReference?): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectInternal $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:sample.input.EmbeddedParent - VALUE_PARAMETER name: index:0 type:io.realm.kotlin.internal.RealmObjectReference? + VALUE_PARAMETER name: index:0 type:io.realm.kotlin.internal.RealmObjectReference? BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=kotlin.Unit origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.EmbeddedParent declared in sample.input.EmbeddedParent.' type=sample.input.EmbeddedParent origin=null - value: GET_VAR ': io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.EmbeddedParent.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + value: GET_VAR ': io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.EmbeddedParent.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null CLASS CLASS name:EmbeddedChild modality:OPEN visibility:public superTypes:[io.realm.kotlin.types.EmbeddedRealmObject; io.realm.kotlin.internal.RealmObjectInternal] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:sample.input.EmbeddedChild CONSTRUCTOR visibility:public <> () returnType:sample.input.EmbeddedChild [primary] @@ -3178,13 +3591,13 @@ MODULE_FRAGMENT name:
BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String? declared in sample.input.EmbeddedChild' BLOCK type=kotlin.String? origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.EmbeddedChild' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.EmbeddedChild' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.EmbeddedChild declared in sample.input.EmbeddedChild.' type=sample.input.EmbeddedChild origin=null WHEN type=kotlin.String? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.EmbeddedChild.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.EmbeddedChild.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String? visibility:private' type=kotlin.String? origin=null receiver: GET_VAR ': sample.input.EmbeddedChild declared in sample.input.EmbeddedChild.' type=sample.input.EmbeddedChild origin=null @@ -3193,7 +3606,7 @@ MODULE_FRAGMENT name:
then: CALL 'public final fun realmValueToAny (realmValue: io.realm.kotlin.internal.interop.RealmValue): kotlin.Any? [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=kotlin.Any? origin=null realmValue: CALL 'internal final fun getValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.RealmObjectHelper' type=io.realm.kotlin.internal.interop.RealmValue origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.EmbeddedChild.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.EmbeddedChild.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="name" FUN name: visibility:public modality:FINAL <> ($this:sample.input.EmbeddedChild, :kotlin.String?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:name visibility:public modality:FINAL [var] @@ -3201,13 +3614,13 @@ MODULE_FRAGMENT name:
VALUE_PARAMETER name: index:0 type:kotlin.String? BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] - CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.EmbeddedChild' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY + VAR IR_TEMPORARY_VARIABLE name:tmp0_objectReference type:io.realm.kotlin.internal.RealmObjectReference? [val] + CALL 'public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.EmbeddedChild' type=io.realm.kotlin.internal.RealmObjectReference? origin=GET_PROPERTY $this: GET_VAR ': sample.input.EmbeddedChild declared in sample.input.EmbeddedChild.' type=sample.input.EmbeddedChild origin=null WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.EmbeddedChild.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + arg0: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.EmbeddedChild.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null arg1: CONST Null type=kotlin.Nothing? value=null then: SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.EmbeddedChild declared in sample.input.EmbeddedChild.' type=sample.input.EmbeddedChild origin=null @@ -3216,7 +3629,7 @@ MODULE_FRAGMENT name:
if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'internal final fun setValue (obj: io.realm.kotlin.internal.RealmObjectReference, propertyName: kotlin.String, value: io.realm.kotlin.internal.interop.RealmValue): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectHelper' type=kotlin.Unit origin=GET_PROPERTY $this: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:RealmObjectHelper modality:FINAL visibility:internal superTypes:[kotlin.Any]' type=io.realm.kotlin.internal.RealmObjectHelper - obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.EmbeddedChild.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + obj: GET_VAR 'val tmp0_objectReference: io.realm.kotlin.internal.RealmObjectReference? [val] declared in sample.input.EmbeddedChild.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null propertyName: CONST String type=kotlin.String value="name" value: CALL 'public final fun anyToRealmValue (value: kotlin.Any?): io.realm.kotlin.internal.interop.RealmValue [inline] declared in io.realm.kotlin.internal.ConvertersKt' type=io.realm.kotlin.internal.interop.RealmValue origin=null value: GET_VAR ': kotlin.String? declared in sample.input.EmbeddedChild.' type=kotlin.String? origin=null @@ -3347,25 +3760,25 @@ MODULE_FRAGMENT name:
public open fun toString (): kotlin.String [fake_override] declared in io.realm.kotlin.types.EmbeddedRealmObject $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] - FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private + FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private EXPRESSION_BODY CONST Null type=kotlin.Nothing? value=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:sample.input.EmbeddedChild) returnType:io.realm.kotlin.internal.RealmObjectReference? + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:sample.input.EmbeddedChild) returnType:io.realm.kotlin.internal.RealmObjectReference? correspondingProperty: PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] overridden: public abstract fun (): io.realm.kotlin.internal.RealmObjectReference? declared in io.realm.kotlin.internal.RealmObjectInternal $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:sample.input.EmbeddedChild BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.EmbeddedChild' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + RETURN type=kotlin.Nothing from='public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.EmbeddedChild' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=io.realm.kotlin.internal.RealmObjectReference? origin=null receiver: GET_VAR ': sample.input.EmbeddedChild declared in sample.input.EmbeddedChild.' type=sample.input.EmbeddedChild origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:sample.input.EmbeddedChild, :io.realm.kotlin.internal.RealmObjectReference?) returnType:kotlin.Unit + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:sample.input.EmbeddedChild, :io.realm.kotlin.internal.RealmObjectReference?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] overridden: public abstract fun (: io.realm.kotlin.internal.RealmObjectReference?): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectInternal $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:sample.input.EmbeddedChild - VALUE_PARAMETER name: index:0 type:io.realm.kotlin.internal.RealmObjectReference? + VALUE_PARAMETER name: index:0 type:io.realm.kotlin.internal.RealmObjectReference? BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=kotlin.Unit origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': sample.input.EmbeddedChild declared in sample.input.EmbeddedChild.' type=sample.input.EmbeddedChild origin=null - value: GET_VAR ': io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.EmbeddedChild.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + value: GET_VAR ': io.realm.kotlin.internal.RealmObjectReference? declared in sample.input.EmbeddedChild.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null diff --git a/packages/plugin-compiler/src/test/resources/sample/input/Sample.kt b/packages/plugin-compiler/src/test/resources/sample/input/Sample.kt index 277b380e3e..21d7d8bfa9 100644 --- a/packages/plugin-compiler/src/test/resources/sample/input/Sample.kt +++ b/packages/plugin-compiler/src/test/resources/sample/input/Sample.kt @@ -16,6 +16,7 @@ package sample.input +import io.realm.kotlin.ext.realmListOf import io.realm.kotlin.types.EmbeddedRealmObject import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant @@ -25,6 +26,7 @@ import io.realm.kotlin.types.annotations.Ignore import io.realm.kotlin.types.annotations.Index import io.realm.kotlin.types.annotations.PrimaryKey import io.realm.kotlin.ext.realmListOf +import io.realm.kotlin.types.RealmUUID import java.util.* class Sample : RealmObject { @@ -52,6 +54,8 @@ class Sample : RealmObject { var doubleField: Double? = 1.19840122 var timestampField: RealmInstant? = RealmInstant.from(0,0) var objectIdField: ObjectId? = ObjectId.create() + var uuidField: RealmUUID? = RealmUUID.random() + var byteArrayField: ByteArray? = null var child: Child? = null // List types @@ -66,6 +70,8 @@ class Sample : RealmObject { var doubleListField: RealmList = realmListOf() var timestampListField: RealmList = realmListOf() var objectIdListField: RealmList = realmListOf() + var uuidListField: RealmList = realmListOf() + var binaryListField: RealmList = realmListOf() var objectListField: RealmList = realmListOf() var embeddedRealmObjectListField: RealmList = realmListOf() @@ -81,6 +87,8 @@ class Sample : RealmObject { var nullableDoubleListField: RealmList = realmListOf() var nullableTimestampListField: RealmList = realmListOf() var nullableObjectIdListField: RealmList = realmListOf() + var nullableUUIDListField: RealmList = realmListOf() + var nullableBinaryListField: RealmList = realmListOf() fun dumpSchema(): String = "${Sample.`io_realm_kotlin_schema`()}" } diff --git a/packages/plugin-compiler/src/test/resources/schema/expected/00_ValidateIrBeforeLowering.ir b/packages/plugin-compiler/src/test/resources/schema/expected/00_ValidateIrBeforeLowering.ir index 200fed5021..05ee8d1f19 100644 --- a/packages/plugin-compiler/src/test/resources/schema/expected/00_ValidateIrBeforeLowering.ir +++ b/packages/plugin-compiler/src/test/resources/schema/expected/00_ValidateIrBeforeLowering.ir @@ -118,28 +118,28 @@ MODULE_FRAGMENT name:
public open fun toString (): kotlin.String [fake_override] declared in io.realm.kotlin.types.RealmObject $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] - FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private + FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private EXPRESSION_BODY CONST Null type=kotlin.Nothing? value=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:schema.input.A) returnType:io.realm.kotlin.internal.RealmObjectReference? + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:schema.input.A) returnType:io.realm.kotlin.internal.RealmObjectReference? correspondingProperty: PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] overridden: public abstract fun (): io.realm.kotlin.internal.RealmObjectReference? declared in io.realm.kotlin.internal.RealmObjectInternal $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:schema.input.A BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in schema.input.A' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + RETURN type=kotlin.Nothing from='public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in schema.input.A' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=io.realm.kotlin.internal.RealmObjectReference? origin=null receiver: GET_VAR ': schema.input.A declared in schema.input.A.' type=schema.input.A origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:schema.input.A, :io.realm.kotlin.internal.RealmObjectReference?) returnType:kotlin.Unit + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:schema.input.A, :io.realm.kotlin.internal.RealmObjectReference?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] overridden: public abstract fun (: io.realm.kotlin.internal.RealmObjectReference?): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectInternal $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:schema.input.A - VALUE_PARAMETER name: index:0 type:io.realm.kotlin.internal.RealmObjectReference? + VALUE_PARAMETER name: index:0 type:io.realm.kotlin.internal.RealmObjectReference? BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=kotlin.Unit origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': schema.input.A declared in schema.input.A.' type=schema.input.A origin=null - value: GET_VAR ': io.realm.kotlin.internal.RealmObjectReference? declared in schema.input.A.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + value: GET_VAR ': io.realm.kotlin.internal.RealmObjectReference? declared in schema.input.A.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null CLASS CLASS name:B modality:OPEN visibility:public superTypes:[io.realm.kotlin.types.RealmObject; io.realm.kotlin.internal.RealmObjectInternal] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:schema.input.B CONSTRUCTOR visibility:public <> () returnType:schema.input.B [primary] @@ -257,28 +257,28 @@ MODULE_FRAGMENT name:
public open fun toString (): kotlin.String [fake_override] declared in io.realm.kotlin.types.RealmObject $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] - FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private + FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private EXPRESSION_BODY CONST Null type=kotlin.Nothing? value=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:schema.input.B) returnType:io.realm.kotlin.internal.RealmObjectReference? + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:schema.input.B) returnType:io.realm.kotlin.internal.RealmObjectReference? correspondingProperty: PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] overridden: public abstract fun (): io.realm.kotlin.internal.RealmObjectReference? declared in io.realm.kotlin.internal.RealmObjectInternal $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:schema.input.B BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in schema.input.B' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + RETURN type=kotlin.Nothing from='public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in schema.input.B' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=io.realm.kotlin.internal.RealmObjectReference? origin=null receiver: GET_VAR ': schema.input.B declared in schema.input.B.' type=schema.input.B origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:schema.input.B, :io.realm.kotlin.internal.RealmObjectReference?) returnType:kotlin.Unit + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:schema.input.B, :io.realm.kotlin.internal.RealmObjectReference?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] overridden: public abstract fun (: io.realm.kotlin.internal.RealmObjectReference?): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectInternal $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:schema.input.B - VALUE_PARAMETER name: index:0 type:io.realm.kotlin.internal.RealmObjectReference? + VALUE_PARAMETER name: index:0 type:io.realm.kotlin.internal.RealmObjectReference? BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=kotlin.Unit origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': schema.input.B declared in schema.input.B.' type=schema.input.B origin=null - value: GET_VAR ': io.realm.kotlin.internal.RealmObjectReference? declared in schema.input.B.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + value: GET_VAR ': io.realm.kotlin.internal.RealmObjectReference? declared in schema.input.B.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null CLASS CLASS name:C modality:OPEN visibility:public superTypes:[io.realm.kotlin.types.RealmObject; io.realm.kotlin.internal.RealmObjectInternal] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:schema.input.C CONSTRUCTOR visibility:public <> () returnType:schema.input.C [primary] @@ -396,28 +396,28 @@ MODULE_FRAGMENT name:
public open fun toString (): kotlin.String [fake_override] declared in io.realm.kotlin.types.RealmObject $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] - FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private + FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private EXPRESSION_BODY CONST Null type=kotlin.Nothing? value=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:schema.input.C) returnType:io.realm.kotlin.internal.RealmObjectReference? + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:schema.input.C) returnType:io.realm.kotlin.internal.RealmObjectReference? correspondingProperty: PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] overridden: public abstract fun (): io.realm.kotlin.internal.RealmObjectReference? declared in io.realm.kotlin.internal.RealmObjectInternal $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:schema.input.C BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in schema.input.C' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + RETURN type=kotlin.Nothing from='public open fun (): io.realm.kotlin.internal.RealmObjectReference? declared in schema.input.C' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=io.realm.kotlin.internal.RealmObjectReference? origin=null receiver: GET_VAR ': schema.input.C declared in schema.input.C.' type=schema.input.C origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:schema.input.C, :io.realm.kotlin.internal.RealmObjectReference?) returnType:kotlin.Unit + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:schema.input.C, :io.realm.kotlin.internal.RealmObjectReference?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:io_realm_kotlin_objectReference visibility:public modality:OPEN [var] overridden: public abstract fun (: io.realm.kotlin.internal.RealmObjectReference?): kotlin.Unit declared in io.realm.kotlin.internal.RealmObjectInternal $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:schema.input.C - VALUE_PARAMETER name: index:0 type:io.realm.kotlin.internal.RealmObjectReference? + VALUE_PARAMETER name: index:0 type:io.realm.kotlin.internal.RealmObjectReference? BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=kotlin.Unit origin=null + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:io_realm_kotlin_objectReference type:io.realm.kotlin.internal.RealmObjectReference? visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': schema.input.C declared in schema.input.C.' type=schema.input.C origin=null - value: GET_VAR ': io.realm.kotlin.internal.RealmObjectReference? declared in schema.input.C.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null + value: GET_VAR ': io.realm.kotlin.internal.RealmObjectReference? declared in schema.input.C.' type=io.realm.kotlin.internal.RealmObjectReference? origin=null PROPERTY name:conf1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:conf1 type:io.realm.kotlin.RealmConfiguration visibility:private [final,static] EXPRESSION_BODY diff --git a/test/base/build.gradle.kts b/test/base/build.gradle.kts index a80f7efcc4..3522fbfb91 100644 --- a/test/base/build.gradle.kts +++ b/test/base/build.gradle.kts @@ -49,7 +49,7 @@ kotlin { dependencies { // TODO AtomicFu doesn't work on the test project due to // https://github.com/Kotlin/kotlinx.atomicfu/issues/90#issuecomment-597872907 - implementation("co.touchlab:stately-concurrency:1.1.7") + implementation("co.touchlab:stately-concurrency:1.2.0") implementation(kotlin("test-common")) implementation(kotlin("test-annotations-common")) implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:${Versions.coroutines}") @@ -155,8 +155,15 @@ kotlin { } kotlin { - iosX64("ios") - macosX64("macos") + // define targets depending on the host platform (Apple or Intel) + if(System.getProperty("os.arch") == "aarch64") { + iosSimulatorArm64("ios") + macosArm64("macos") + } else if(System.getProperty("os.arch") == "x86_64") { + iosX64("ios") + macosX64("macos") + } + sourceSets { val macosMain by getting val macosTest by getting diff --git a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/RealmTests.kt b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/RealmTests.kt index 28f52ea9c7..79716bd78e 100644 --- a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/RealmTests.kt +++ b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/RealmTests.kt @@ -26,9 +26,7 @@ import kotlin.test.BeforeTest import kotlin.test.Test import kotlin.test.assertFailsWith import kotlin.test.assertFalse -import kotlin.time.ExperimentalTime -@OptIn(ExperimentalTime::class) class RealmTests { private lateinit var tmpDir: String diff --git a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/ByteArrayTests.kt b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/ByteArrayTests.kt new file mode 100644 index 0000000000..9572d031cd --- /dev/null +++ b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/ByteArrayTests.kt @@ -0,0 +1,161 @@ +package io.realm.kotlin.test.shared + +import io.realm.kotlin.Realm +import io.realm.kotlin.RealmConfiguration +import io.realm.kotlin.entities.Sample +import io.realm.kotlin.ext.query +import io.realm.kotlin.query.find +import io.realm.kotlin.test.assertFailsWithMessage +import io.realm.kotlin.test.platform.PlatformUtils +import kotlin.random.Random +import kotlin.reflect.KMutableProperty1 +import kotlin.test.AfterTest +import kotlin.test.BeforeTest +import kotlin.test.Test +import kotlin.test.assertContentEquals +import kotlin.test.assertNotNull + +const val MAX_BINARY_SIZE = 0xFFFFF8 - 8 /*array header size*/ + +class ByteArrayTests { + + private lateinit var tmpDir: String + private lateinit var realm: Realm + + @BeforeTest + fun setup() { + tmpDir = PlatformUtils.createTempDir() + val configuration = RealmConfiguration.Builder(schema = setOf(Sample::class)) + .directory(tmpDir) + .build() + realm = Realm.open(configuration) + } + + @AfterTest + fun tearDown() { + if (!realm.isClosed()) { + realm.close() + } + PlatformUtils.deleteTempDir(tmpDir) + } + + @Test + fun boundaries() { + val longBinary = Random.nextBytes(MAX_BINARY_SIZE) + val tooLongBinary = Random.nextBytes(MAX_BINARY_SIZE + 1) + + // Test long array + val sample = Sample().apply { binaryField = longBinary } + roundTrip(sample, Sample::binaryField) { value -> + assertContentEquals(longBinary, value) + } + + // Test too long array + realm.writeBlocking { + // Copy object again since they get removed during the roundTrip call + copyToRealm(sample) + + query() + .first() + .find { sample -> + assertNotNull(sample) + assertFailsWithMessage("too big") { + sample.binaryField = tooLongBinary + } + } + } + } + + @Test + fun equals_defaultValues() { + val sample = Sample() + roundTrip(sample, Sample::binaryField) { value -> + assertContentEquals(sample.binaryField, value) + } + roundTrip(sample, Sample::nullableBinaryField) { value -> + assertContentEquals(sample.nullableBinaryField, value) + } + } + + @Test + fun equals_assignedValues() { + val byteArray = Random.nextBytes(128) + roundTrip(byteArray, Sample::binaryField) { value -> + assertContentEquals(byteArray, value) + } + roundTrip(byteArray, Sample::nullableBinaryField) { value -> + assertContentEquals(byteArray, value) + } + } + + @Test + fun query_withByteArrayAsParameter() { + // Run a query with a ByteArray param to check we set the values correctly in the C struct + val sample = Sample() + realm.writeBlocking { + copyToRealm(sample) + + // Query using the default value from the sample object + query("binaryField = $0", sample.binaryField) + .first() + .find { managedSample -> + assertNotNull(managedSample) + assertContentEquals(sample.binaryField, managedSample.binaryField) + } + } + + // Repeat query outside write transaction + realm.query("binaryField = $0", sample.binaryField) + .first() + .find { managedSample -> + assertNotNull(managedSample) + assertContentEquals(sample.binaryField, managedSample.binaryField) + } + } + + // Store value and retrieve it again + private fun roundTrip( + sample: Sample, + property: KMutableProperty1, + function: (T) -> Unit + ) { + // Test managed objects + realm.writeBlocking { + copyToRealm(sample) + val managedByteArray = query() + // val managedByteArray = query("binaryField = $0", byteArrayOf(42)) + .first() + .find { sampleObject -> + assertNotNull(sampleObject) + val binaryProperty = property.get(sampleObject) + binaryProperty + } + function(managedByteArray) + } + + // Launch query outside transaction + val managedSampleObject = realm.query() + .first() + .find { sampleObject -> + assertNotNull(sampleObject) + sampleObject + } + val binary = property.get(managedSampleObject) + function(binary) + + // Delete to avoid messing up with .first() in successive assertions within the same test + realm.writeBlocking { + delete(query()) + } + } + + // Store value and retrieve it again + @Suppress("UNCHECKED_CAST") + private fun roundTrip( + byteArray: ByteArray, + property: KMutableProperty1, + function: (T) -> Unit + ) { + roundTrip(Sample().apply { property.set(this, byteArray as T) }, property, function) + } +} diff --git a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/ImportTests.kt b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/ImportTests.kt index bd91998c43..b5084e9cac 100644 --- a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/ImportTests.kt +++ b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/ImportTests.kt @@ -27,9 +27,11 @@ import io.realm.kotlin.test.util.TypeDescriptor.classifiers import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.RealmUUID import kotlin.test.AfterTest import kotlin.test.BeforeTest import kotlin.test.Test +import kotlin.test.assertContentEquals import kotlin.test.assertEquals import kotlin.test.assertFailsWith import kotlin.test.assertNotNull @@ -81,7 +83,9 @@ class ImportTests { Double::class -> assertEquals(1.19840122, managed.doubleField) RealmInstant::class -> assertEquals(RealmInstant.from(100, 1000), managed.timestampField) ObjectId::class -> assertEquals(ObjectId.from("507f1f77bcf86cd799439011"), managed.objectIdField) + RealmUUID::class -> assertEquals(RealmUUID.from("46423f1b-ce3e-4a7e-812f-004cf9c42d76"), managed.uuidField) RealmObject::class -> assertEquals(null, managed.nullableObject) + ByteArray::class -> assertContentEquals(byteArrayOf(42), managed.binaryField) else -> error("Untested type: $type") } } diff --git a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/NullabilityTests.kt b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/NullabilityTests.kt index 9c316ccaae..fc002b6bd8 100644 --- a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/NullabilityTests.kt +++ b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/NullabilityTests.kt @@ -23,11 +23,13 @@ import io.realm.kotlin.test.platform.PlatformUtils import io.realm.kotlin.test.util.TypeDescriptor import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant +import io.realm.kotlin.types.RealmUUID import kotlin.reflect.KClassifier import kotlin.reflect.KMutableProperty1 import kotlin.test.AfterTest import kotlin.test.BeforeTest import kotlin.test.Test +import kotlin.test.assertContentEquals import kotlin.test.assertEquals import kotlin.test.assertNotNull import kotlin.test.assertNull @@ -90,7 +92,11 @@ class NullabilityTests { fun testProperty(property: KMutableProperty1, value: T) { assertNull(property.get(nullableObj)) property.set(nullableObj, value) - assertEquals(value, property.get(nullableObj)) + if (value is ByteArray) { + assertContentEquals(value, property.get(nullableObj) as ByteArray) + } else { + assertEquals(value, property.get(nullableObj)) + } property.set(nullableObj, null) assertNull(property.get(nullableObj)) nullableFieldTypes.remove(property.returnType.classifier) @@ -107,6 +113,8 @@ class NullabilityTests { testProperty(Nullability::objectField, null) testProperty(Nullability::timestampField, RealmInstant.from(42, 420)) testProperty(Nullability::objectIdField, ObjectId.from("507f191e810c19729de860ea")) + testProperty(Nullability::uuidField, RealmUUID.random()) + testProperty(Nullability::binaryField, byteArrayOf(42)) // Manually removing RealmObject as nullableFieldTypes is not referencing the // explicit subtype (Nullability). Don't know how to make the linkage without // so it also works on Native. diff --git a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/PrimaryKeyTests.kt b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/PrimaryKeyTests.kt index afff40303d..9ed1a2b165 100644 --- a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/PrimaryKeyTests.kt +++ b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/PrimaryKeyTests.kt @@ -28,6 +28,8 @@ import io.realm.kotlin.entities.primarykey.PrimaryKeyLong import io.realm.kotlin.entities.primarykey.PrimaryKeyLongNullable import io.realm.kotlin.entities.primarykey.PrimaryKeyObjectId import io.realm.kotlin.entities.primarykey.PrimaryKeyObjectIdNullable +import io.realm.kotlin.entities.primarykey.PrimaryKeyRealmUUID +import io.realm.kotlin.entities.primarykey.PrimaryKeyRealmUUIDNullable import io.realm.kotlin.entities.primarykey.PrimaryKeyShort import io.realm.kotlin.entities.primarykey.PrimaryKeyShortNullable import io.realm.kotlin.entities.primarykey.PrimaryKeyString @@ -40,6 +42,7 @@ import io.realm.kotlin.test.util.TypeDescriptor.allPrimaryKeyFieldTypes import io.realm.kotlin.test.util.TypeDescriptor.rType import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.RealmUUID import kotlin.reflect.typeOf import kotlin.test.AfterTest import kotlin.test.BeforeTest @@ -164,7 +167,9 @@ class PrimaryKeyTests { typeOf(), typeOf(), typeOf(), - typeOf() + typeOf(), + typeOf(), + typeOf(), ).map { it.rType() }.toMutableSet() assertTrue(expectedTypes.containsAll(allPrimaryKeyFieldTypes)) @@ -191,7 +196,9 @@ class PrimaryKeyTests { PrimaryKeyString::class, PrimaryKeyStringNullable::class, PrimaryKeyObjectId::class, - PrimaryKeyObjectIdNullable::class + PrimaryKeyObjectIdNullable::class, + PrimaryKeyRealmUUID::class, + PrimaryKeyRealmUUIDNullable::class, ) val configuration = RealmConfiguration.Builder( @@ -210,6 +217,8 @@ class PrimaryKeyTests { PrimaryKeyStringNullable::class, PrimaryKeyObjectId::class, PrimaryKeyObjectIdNullable::class, + PrimaryKeyRealmUUID::class, + PrimaryKeyRealmUUIDNullable::class, ) ) .directory(tmpDir) diff --git a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/QueryTests.kt b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/QueryTests.kt index 95d69b0441..3066938bdd 100644 --- a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/QueryTests.kt +++ b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/QueryTests.kt @@ -45,6 +45,7 @@ import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmList import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.RealmUUID import kotlinx.coroutines.TimeoutCancellationException import kotlinx.coroutines.async import kotlinx.coroutines.channels.Channel @@ -141,6 +142,12 @@ class QueryTests { RealmStorageType.OBJECT_ID -> { realm.query("objectIdField = $0", ObjectId.from("507f191e810c19729de860ea")) } + RealmStorageType.UUID -> { + realm.query("uuidField = $0", RealmUUID.from("46423f1b-ce3e-4a7e-812f-004cf9c42d76")) + } + RealmStorageType.BINARY -> { + realm.query("binaryField = $0", byteArrayOf(42)) + } else -> fail("Unknown type: $type") } } @@ -2482,6 +2489,8 @@ class QuerySample() : RealmObject { var doubleField: Double = 0.0 var timestampField: RealmInstant = RealmInstant.from(100, 1000) var objectIdField: ObjectId = ObjectId.from("507f191e810c19729de860ea") + var uuidField: RealmUUID = RealmUUID.from("46423f1b-ce3e-4a7e-812f-004cf9c42d76") + var binaryField: ByteArray = byteArrayOf(42) var nullableStringField: String? = null var nullableByteField: Byte? = null @@ -2493,6 +2502,8 @@ class QuerySample() : RealmObject { var nullableFloatField: Float? = null var nullableDoubleField: Double? = null var nullableTimestampField: RealmInstant? = null + var nullableObjectIdField: ObjectId? = null + var nullableBinaryField: ByteArray? = null var stringListField: RealmList = realmListOf() var byteListField: RealmList = realmListOf() @@ -2504,6 +2515,7 @@ class QuerySample() : RealmObject { var floatListField: RealmList = realmListOf() var doubleListField: RealmList = realmListOf() var timestampListField: RealmList = realmListOf() + var objectIdListField: RealmList = realmListOf() var objectListField: RealmList = realmListOf() var nullableStringListField: RealmList = realmListOf() @@ -2516,6 +2528,7 @@ class QuerySample() : RealmObject { var nullableFloatListField: RealmList = realmListOf() var nullableDoubleListField: RealmList = realmListOf() var nullableTimestampListField: RealmList = realmListOf() + var nullableObjectIdListField: RealmList = realmListOf() var child: QuerySample? = null } diff --git a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/RealmListTests.kt b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/RealmListTests.kt index 844a842841..54ec59da02 100644 --- a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/RealmListTests.kt +++ b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/RealmListTests.kt @@ -37,6 +37,7 @@ import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmList import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.RealmUUID import kotlinx.coroutines.async import kotlinx.coroutines.flow.takeWhile import kotlinx.coroutines.runBlocking @@ -427,25 +428,25 @@ class RealmListTests { String::class -> if (nullable) NULLABLE_STRING_VALUES else STRING_VALUES RealmInstant::class -> if (nullable) NULLABLE_TIMESTAMP_VALUES else TIMESTAMP_VALUES ObjectId::class -> if (nullable) NULLABLE_OBJECT_ID_VALUES else OBJECT_ID_VALUES + RealmUUID::class -> if (nullable) NULLABLE_UUID_VALUES else UUID_VALUES + ByteArray::class -> if (nullable) NULLABLE_BINARY_VALUES else BINARY_VALUES RealmObject::class -> OBJECT_VALUES else -> throw IllegalArgumentException("Wrong classifier: '$classifier'") } as List - private fun getTypeSafety(classifier: KClassifier, nullable: Boolean): TypeSafetyManager<*> { - return if (nullable) { - NullableList( + private fun getTypeSafety(classifier: KClassifier, nullable: Boolean): TypeSafetyManager<*> = + when { + nullable -> NullableList( classifier = classifier, property = RealmListContainer.nullableProperties[classifier]!!, dataSet = getDataSetForClassifier(classifier, true) ) - } else { - NonNullableList( + else -> NonNullableList( classifier = classifier, property = RealmListContainer.nonNullableProperties[classifier]!!, dataSet = getDataSetForClassifier(classifier, false) ) } - } private val managedTesters: List by lazy { descriptors.map { @@ -459,6 +460,10 @@ class RealmListTests { dataSet = OBJECT_VALUES ) ) + ByteArray::class -> ManagedByteArrayListTester( + realm = realm, + typeSafetyManager = getTypeSafety(classifier, elementType.nullable) as TypeSafetyManager + ) else -> ManagedGenericListTester( realm = realm, typeSafetyManager = getTypeSafety(classifier, elementType.nullable) @@ -641,8 +646,10 @@ internal abstract class ManagedListTester( val dataSet = typeSafetyManager.getInitialDataSet() val assertions = { container: RealmListContainer -> - dataSet.forEachIndexed { index, t -> - assertElementsAreEqual(t, typeSafetyManager.getList(container)[index]) + dataSet.forEachIndexed { index, expected -> + val list = typeSafetyManager.getList(container) + val actual = list[index] + assertElementsAreEqual(expected, actual) } } @@ -987,15 +994,21 @@ internal abstract class ManagedListTester( assertEquals(1, list.size) // We cannot assert equality on RealmObject lists as the object isn't equals to the // unmanaged object from before the assignment - if (list[0] !is RealmObject) { - assertContentEquals(reassignedDataSet, list) + if (list[0] is ByteArray) { + reassignedDataSet.zip(list) + .forEach { (expected, actual) -> + assertElementsAreEqual(expected, actual) + } + } else if (list[0] is RealmObject) { + reassignedDataSet.zip(list) + .forEach { (expected, actual) -> + assertEquals( + (expected as RealmListContainer).stringField, + (actual as RealmListContainer).stringField + ) + } } else { - reassignedDataSet.zip(list).forEach { (expected, actual) -> - assertEquals( - (expected as RealmListContainer).stringField, - (actual as RealmListContainer).stringField - ) - } + assertContentEquals(reassignedDataSet, list) } } errorCatcher { @@ -1056,7 +1069,13 @@ internal class ManagedGenericListTester( realm: Realm, typeSafetyManager: TypeSafetyManager ) : ManagedListTester(realm, typeSafetyManager) { - override fun assertElementsAreEqual(expected: T, actual: T) = assertEquals(expected, actual) + override fun assertElementsAreEqual(expected: T, actual: T) { + if (expected is ByteArray) { + assertContentEquals(expected, actual as ByteArray) + } else { + assertEquals(expected, actual) + } + } } /** @@ -1071,6 +1090,17 @@ internal class ManagedRealmObjectListTester( assertEquals(expected.stringField, actual.stringField) } +/** + * Check equality for ByteArrays at a structural level with `assertContentEquals`. + */ +internal class ManagedByteArrayListTester( + realm: Realm, + typeSafetyManager: TypeSafetyManager +) : ManagedListTester(realm, typeSafetyManager) { + override fun assertElementsAreEqual(expected: ByteArray?, actual: ByteArray?) = + assertContentEquals(expected, actual) +} + // ----------------------------------- // Data used to initialize structures // ----------------------------------- @@ -1088,6 +1118,8 @@ internal val TIMESTAMP_VALUES = listOf(RealmInstant.from(0, 0), RealmInstant.from(42, 420)) internal val OBJECT_ID_VALUES = listOf(ObjectId.create(), ObjectId.from("507f191e810c19729de860ea")) +internal val UUID_VALUES = + listOf(RealmUUID.random(), RealmUUID.from("46423f1b-ce3e-4a7e-812f-004cf9c42d76")) internal val OBJECT_VALUES = listOf( RealmListContainer().apply { stringField = "A" }, @@ -1103,6 +1135,7 @@ internal val OBJECT_VALUES3 = listOf( RealmListContainer().apply { stringField = "G" }, RealmListContainer().apply { stringField = "H" } ) +internal val BINARY_VALUES = listOf(byteArrayOf(22), byteArrayOf(66)) internal val NULLABLE_CHAR_VALUES = CHAR_VALUES + null internal val NULLABLE_STRING_VALUES = STRING_VALUES + null @@ -1115,3 +1148,5 @@ internal val NULLABLE_DOUBLE_VALUES = DOUBLE_VALUES + null internal val NULLABLE_BOOLEAN_VALUES = BOOLEAN_VALUES + null internal val NULLABLE_TIMESTAMP_VALUES = TIMESTAMP_VALUES + null internal val NULLABLE_OBJECT_ID_VALUES = OBJECT_ID_VALUES + null +internal val NULLABLE_UUID_VALUES = UUID_VALUES + null +internal val NULLABLE_BINARY_VALUES = BINARY_VALUES + null diff --git a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/RealmTests.kt b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/RealmTests.kt index c884040a42..069c4ef66f 100644 --- a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/RealmTests.kt +++ b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/RealmTests.kt @@ -15,6 +15,7 @@ */ package io.realm.kotlin.test.shared +import io.realm.kotlin.Configuration import io.realm.kotlin.Realm import io.realm.kotlin.RealmConfiguration import io.realm.kotlin.VersionId @@ -26,6 +27,8 @@ import io.realm.kotlin.ext.version import io.realm.kotlin.query.find import io.realm.kotlin.test.assertFailsWithMessage import io.realm.kotlin.test.platform.PlatformUtils +import io.realm.kotlin.test.platform.platformFileSystem +import io.realm.kotlin.test.util.use import kotlinx.coroutines.Job import kotlinx.coroutines.async import kotlinx.coroutines.cancelAndJoin @@ -37,6 +40,8 @@ import kotlinx.coroutines.runBlocking import kotlinx.coroutines.sync.Mutex import okio.FileSystem import okio.Path.Companion.toPath +import kotlin.random.Random +import kotlin.random.Random.Default.nextBytes import kotlin.test.AfterTest import kotlin.test.BeforeTest import kotlin.test.Ignore @@ -468,6 +473,18 @@ class RealmTests { } } + @Test + fun deleteRealm_fileDoesNotExists() { + val fileSystem = FileSystem.SYSTEM + val testDir = PlatformUtils.createTempDir("test_dir") + val configuration = RealmConfiguration.Builder(schema = setOf(Parent::class, Child::class)) + .directory(testDir) + .build() + assertFalse(fileSystem.exists(configuration.path.toPath())) + Realm.deleteRealm(configuration) // No-op if file doesn't exists + assertFalse(fileSystem.exists(configuration.path.toPath())) + } + @Test fun deleteRealm_failures() { val tempDirA = PlatformUtils.createTempDir() @@ -494,6 +511,101 @@ class RealmTests { } } + private fun createWriteCopyLocalConfig(name: String, encryptionKey: ByteArray? = null): RealmConfiguration { + val builder = RealmConfiguration.Builder(schema = setOf(Parent::class, Child::class)) + .directory(tmpDir) + .name(name) + if (encryptionKey != null) { + builder.encryptionKey(encryptionKey) + } + return builder.build() + } + + private fun writeCopy(from: Configuration, to: Configuration) { + Realm.open(from).use { realm -> + realm.writeBlocking { + repeat(1000) { i: Int -> + copyToRealm( + Parent().apply { + name = "Object-$i" + } + ) + } + } + realm.writeCopyTo(to) + } + } + + @Test + fun writeCopyTo_localToLocal() { + val configA: RealmConfiguration = createWriteCopyLocalConfig("fileA.realm") + val configB: RealmConfiguration = createWriteCopyLocalConfig("fileB.realm") + + writeCopy(from = configA, to = configB) + + // Copy is compacted i.e. smaller than original. + val fileASize: Long = platformFileSystem.metadata(configA.path.toPath()).size!! + val fileBSize: Long = platformFileSystem.metadata(configB.path.toPath()).size!! + assertTrue(fileASize >= fileBSize, "$fileASize >= $fileBSize") + // Content is copied + Realm.open(configB).use { realm -> + assertEquals(1000, realm.query().count().find()) + } + } + + @Test + fun writeCopyTo_localToLocalEncrypted() { + val configA: RealmConfiguration = createWriteCopyLocalConfig("fileA.realm") + val configBEncrypted: RealmConfiguration = createWriteCopyLocalConfig("fileB.realm", Random.Default.nextBytes(Realm.ENCRYPTION_KEY_LENGTH)) + + writeCopy(from = configA, to = configBEncrypted) + + // Ensure that new Realm is encrypted + val configBUnencrypted: RealmConfiguration = RealmConfiguration.Builder(schema = setOf(Parent::class, Child::class)) + .directory(tmpDir) + .name("fileB.realm") + .build() + + assertFailsWith { + Realm.open(configBUnencrypted) + } + + Realm.open(configBEncrypted).use { realm -> + assertEquals(1000, realm.query().count().find()) + } + } + + @Test + fun writeCopyTo_localEncryptedToLocal() { + val key = Random.Default.nextBytes(Realm.ENCRYPTION_KEY_LENGTH) + val configAEncrypted: RealmConfiguration = createWriteCopyLocalConfig("fileA.realm", key) + val configB: RealmConfiguration = createWriteCopyLocalConfig("fileB.realm") + + writeCopy(from = configAEncrypted, to = configB) + + // Ensure that new Realm is not encrypted + val configBEncrypted: RealmConfiguration = createWriteCopyLocalConfig("fileB.realm", key) + assertFailsWith { + Realm.open(configBEncrypted) + } + + Realm.open(configB).use { realm -> + assertEquals(1000, realm.query().count().find()) + } + } + + @Test + fun writeCopyTo_destinationAlreadyExist_throws() { + val configA: RealmConfiguration = createWriteCopyLocalConfig("fileA.realm") + val configB: RealmConfiguration = createWriteCopyLocalConfig("fileB.realm") + Realm.open(configB).use {} + Realm.open(configA).use { realm -> + assertFailsWith { + realm.writeCopyTo(configB) + } + } + } + // TODO Cannot verify intermediate versions as they are now spread across user facing, notifier // and writer realms. Tests were anyway ignored, so don't really know what to do with these. // @Test diff --git a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/RealmUUIDTests.kt b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/RealmUUIDTests.kt new file mode 100644 index 0000000000..79ba0277fb --- /dev/null +++ b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/RealmUUIDTests.kt @@ -0,0 +1,146 @@ +/* + * Copyright 2022 Realm Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.realm.kotlin.test.shared + +import io.realm.kotlin.test.assertFailsWithMessage +import io.realm.kotlin.types.RealmUUID +import kotlin.experimental.and +import kotlin.test.Test +import kotlin.test.assertContains +import kotlin.test.assertContentEquals +import kotlin.test.assertEquals +import kotlin.test.assertFalse +import kotlin.test.assertNotEquals + +class RealmUUIDTests { + @Test + fun from_uuidString() { + // empty string + assertFailsWithMessage("Invalid string representation of an UUID: ''") { + RealmUUID.from("") // empty string + } + + // invalid hex values + assertFailsWithMessage("Invalid string representation of an UUID: '893062aa-3207-49ad-xxxx-8db653771cdb'") { + RealmUUID.from("893062aa-3207-49ad-xxxx-8db653771cdb") // invalid uuid value + } + + // No hyphens + assertFailsWithMessage("Invalid string representation of an UUID: '893062aa320749ad931c8db653771cdb'") { + RealmUUID.from("893062aa320749ad931c8db653771cdb") // invalid uuid value + } + + // validate regex boundaries + assertFailsWithMessage("Invalid string representation of an UUID: '00000000-0000-0000-0000-000000000000 '") { + RealmUUID.from( + """ + 00000000-0000-0000-0000-000000000000 + """.trimIndent() + ) // invalid uuid value + } + + // validate regex boundaries + assertFailsWithMessage("Invalid string representation of an UUID: '00000000-0000-0000-0000-00000000000000000000-0000-0000-0000-000000000000'") { + RealmUUID.from("00000000-0000-0000-0000-00000000000000000000-0000-0000-0000-000000000000") // invalid uuid value + } + + // Boundaries + assertContentEquals( + ByteArray(16) { 0x00.toByte() }, + RealmUUID.from("00000000-0000-0000-0000-000000000000").bytes + ) + + assertContentEquals( + ByteArray(16) { 0xFF.toByte() }, + RealmUUID.from("ffffffff-ffff-ffff-ffff-ffffffffffff").bytes + ) + + assertContentEquals( + ByteArray(16) { 0xFF.toByte() }, + RealmUUID.from("FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF").bytes + ) + } + + @Test + fun from_bytes() { + // empty array + assertFailsWithMessage("Invalid 'bytes' size 0, byte array size must be 16") { + RealmUUID.from(byteArrayOf()) // 16 char needed + } + + // too small array + assertFailsWithMessage("Invalid 'bytes' size 6, byte array size must be 16") { + RealmUUID.from(ByteArray(6) { 0x00 }) + } + + // too large array + assertFailsWithMessage("Invalid 'bytes' size 20, byte array size must be 16") { + RealmUUID.from(ByteArray(20) { 0x00 }) + } + + // Boundaries + assertContentEquals( + ByteArray(16) { 0x00.toByte() }, + RealmUUID.from(ByteArray(16) { 0x00.toByte() }).bytes, + ) + + assertContentEquals( + ByteArray(16) { 0xFF.toByte() }, + RealmUUID.from(ByteArray(16) { 0xFF.toByte() }).bytes, + ) + } + + @Test + fun random() { + val uuidVersion4 = 0x40.toByte() + val version4Variants = byteArrayOf((0b10 shl 6).toByte(), (0b11 shl 6).toByte()) + + // Try with different random values + repeat(10) { + // validate version, 6th byte must be 0x40 + assertEquals(uuidVersion4, RealmUUID.random().bytes[6] and 0xF0.toByte()) + + // validate variant, 8th byte must be 0b10xxxxxx or 0b110xxxxx + assertContains(version4Variants, RealmUUID.random().bytes[8] and 0xC0.toByte()) + + // it yields different values + val uuid1 = RealmUUID.random() + val uuid2 = RealmUUID.random() + + assertFalse(uuid1.bytes.contentEquals(uuid2.bytes)) + assertNotEquals(uuid1, uuid2) + } + } + + @Test + fun to_string() { + val uuidTestStrings = arrayOf( + "7cfaa594-7441-4bc3-87fc-7a73019c9520", + "00000000-0000-0000-0000-000000000000", + "ffffffff-ffff-ffff-ffff-ffffffffffff", + "b3c1755a-6886-4c6c-9c39-ea4f8fa38899" + ) + + for (uuidString in uuidTestStrings) { + val uuid = RealmUUID.from(uuidString) + val copy = RealmUUID.from(uuid.toString()) + + assertEquals(uuid, copy) + assertNotEquals(RealmUUID.random(), uuid) + } + } +} diff --git a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/dynamic/DynamicMutableRealmObjectTests.kt b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/dynamic/DynamicMutableRealmObjectTests.kt index b8429d433b..d08ccaa647 100644 --- a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/dynamic/DynamicMutableRealmObjectTests.kt +++ b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/dynamic/DynamicMutableRealmObjectTests.kt @@ -15,21 +15,6 @@ */ @file:Suppress("invisible_member", "invisible_reference") -/* - * Copyright 2022 Realm Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ package io.realm.kotlin.test.shared.dynamic @@ -61,10 +46,12 @@ import io.realm.kotlin.test.assertFailsWithMessage import io.realm.kotlin.test.platform.PlatformUtils import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant +import io.realm.kotlin.types.RealmUUID import kotlinx.coroutines.test.runTest import kotlin.test.AfterTest import kotlin.test.BeforeTest import kotlin.test.Test +import kotlin.test.assertContentEquals import kotlin.test.assertEquals import kotlin.test.assertNotNull import kotlin.test.assertTrue @@ -205,6 +192,20 @@ class DynamicMutableRealmObjectTests { dynamicSample.set(name, null) assertEquals(null, dynamicSample.getNullableValue(name)) } + RealmStorageType.UUID -> { + val value = RealmUUID.random() + dynamicSample.set(name, value) + assertEquals(value, dynamicSample.getNullableValue(name)) + dynamicSample.set(name, null) + assertEquals(null, dynamicSample.getNullableValue(name)) + } + RealmStorageType.BINARY -> { + val value = byteArrayOf(42) + dynamicSample.set(name, value) + assertContentEquals(value, dynamicSample.getNullableValue(name)) + dynamicSample.set(name, null) + assertEquals(null, dynamicSample.getNullableValue(name)) + } else -> error("Model contains untested properties: $property") } } else { @@ -239,6 +240,16 @@ class DynamicMutableRealmObjectTests { dynamicSample.set(name, value) assertEquals(value, dynamicSample.getValue(name)) } + RealmStorageType.UUID -> { + val value = RealmUUID.random() + dynamicSample.set(name, value) + assertEquals(value, dynamicSample.getValue(name)) + } + RealmStorageType.BINARY -> { + val value = byteArrayOf(42) + dynamicSample.set(name, value) + assertContentEquals(value, dynamicSample.getValue(name)) + } else -> error("Model contains untested properties: $property") } } @@ -309,6 +320,22 @@ class DynamicMutableRealmObjectTests { assertEquals(value, listOfNullable[0]) assertEquals(null, listOfNullable[1]) } + RealmStorageType.UUID -> { + val value = RealmUUID.random() + dynamicSample.getNullableValueList(property.name).add(value) + dynamicSample.getNullableValueList(property.name).add(null) + val listOfNullable = dynamicSample.getNullableValueList(property.name, RealmUUID::class) + assertEquals(value, listOfNullable[0]) + assertEquals(null, listOfNullable[1]) + } + RealmStorageType.BINARY -> { + val value = byteArrayOf(42) + dynamicSample.getNullableValueList(property.name).add(value) + dynamicSample.getNullableValueList(property.name).add(null) + val listOfNullable = dynamicSample.getNullableValueList(property.name, ByteArray::class) + assertContentEquals(value, listOfNullable[0]) + assertEquals(null, listOfNullable[1]) + } else -> error("Model contains untested properties: $property") } } else { @@ -355,6 +382,16 @@ class DynamicMutableRealmObjectTests { dynamicSample.getValueList(property.name).add(value) assertEquals(value, dynamicSample.getValueList(property.name, ObjectId::class)[0]) } + RealmStorageType.UUID -> { + val value = RealmUUID.random() + dynamicSample.getValueList(property.name).add(value) + assertEquals(value, dynamicSample.getValueList(property.name, RealmUUID::class)[0]) + } + RealmStorageType.BINARY -> { + val value = byteArrayOf(42) + dynamicSample.getValueList(property.name).add(value) + assertContentEquals(value, dynamicSample.getValueList(property.name, ByteArray::class)[0]) + } RealmStorageType.OBJECT -> { val value = dynamicMutableRealm.copyToRealm(DynamicMutableRealmObject.create("Sample")).set("stringField", "NEW_OBJECT") dynamicSample.getValueList(property.name).add(value) diff --git a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/dynamic/DynamicRealmObjectTests.kt b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/dynamic/DynamicRealmObjectTests.kt index 52990a12f6..794ffceecd 100644 --- a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/dynamic/DynamicRealmObjectTests.kt +++ b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/dynamic/DynamicRealmObjectTests.kt @@ -15,21 +15,6 @@ */ @file:Suppress("invisible_member", "invisible_reference") -/* - * Copyright 2022 Realm Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ package io.realm.kotlin.test.shared.dynamic @@ -51,9 +36,11 @@ import io.realm.kotlin.test.assertFailsWithMessage import io.realm.kotlin.test.platform.PlatformUtils import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant +import io.realm.kotlin.types.RealmUUID import kotlin.test.AfterTest import kotlin.test.BeforeTest import kotlin.test.Test +import kotlin.test.assertContentEquals import kotlin.test.assertEquals import kotlin.test.assertFailsWith import kotlin.test.assertNotNull @@ -179,6 +166,14 @@ class DynamicRealmObjectTests { assertEquals(null, dynamicSample.getNullableValue(property.name)) assertEquals(null, dynamicSample.getNullableValue(property.name, type.storageType.kClass)) } + RealmStorageType.UUID -> { + assertEquals(null, dynamicSample.getNullableValue(property.name)) + assertEquals(null, dynamicSample.getNullableValue(property.name, type.storageType.kClass)) + } + RealmStorageType.BINARY -> { + assertContentEquals(null, dynamicSample.getNullableValue(property.name)) + assertContentEquals(null, dynamicSample.getNullableValue(property.name, type.storageType.kClass) as ByteArray?) + } else -> error("Model contains untested properties: $property") } } else { @@ -226,6 +221,16 @@ class DynamicRealmObjectTests { assertEquals(expectedSample.objectIdField, dynamicSample.getValue(property.name)) assertEquals(expectedSample.objectIdField, dynamicSample.getValue(property.name, type.storageType.kClass)) } + RealmStorageType.UUID -> { + assertEquals(expectedSample.uuidField, dynamicSample.getValue(property.name)) + assertEquals(expectedSample.uuidField, dynamicSample.getValue(property.name)) + assertEquals(expectedSample.uuidField, dynamicSample.getValue(property.name, type.storageType.kClass)) + } + RealmStorageType.BINARY -> { + assertContentEquals(expectedSample.binaryField, dynamicSample.getValue(property.name)) + assertContentEquals(expectedSample.binaryField, dynamicSample.getValue(property.name)) + assertContentEquals(expectedSample.binaryField, dynamicSample.getValue(property.name, type.storageType.kClass) as ByteArray) + } else -> error("Model contains untested properties: $property") } } @@ -261,6 +266,14 @@ class DynamicRealmObjectTests { assertEquals(null, dynamicSample.getNullableValueList(property.name)[0]) assertEquals(null, dynamicSample.getNullableValueList(property.name, ObjectId::class)[0]) } + RealmStorageType.UUID -> { + assertEquals(null, dynamicSample.getNullableValueList(property.name)[0]) + assertEquals(null, dynamicSample.getNullableValueList(property.name, RealmUUID::class)[0]) + } + RealmStorageType.BINARY -> { + assertContentEquals(null, dynamicSample.getNullableValueList(property.name)[0]) + assertContentEquals(null, dynamicSample.getNullableValueList(property.name, ByteArray::class)[0]) + } RealmStorageType.OBJECT -> { assertEquals(null, dynamicSample.getNullableValueList(property.name)[0]) assertEquals(null, dynamicSample.getNullableValueList(property.name, DynamicRealmObject::class)[0]) @@ -311,6 +324,16 @@ class DynamicRealmObjectTests { assertEquals(expectedValue, dynamicSample.getValueList(property.name)[0]) assertEquals(expectedValue, dynamicSample.getValueList(property.name, ObjectId::class)[0]) } + RealmStorageType.UUID -> { + val expectedValue = defaultSample.uuidField + assertEquals(expectedValue, dynamicSample.getValueList(property.name)[0]) + assertEquals(expectedValue, dynamicSample.getValueList(property.name, RealmUUID::class)[0]) + } + RealmStorageType.BINARY -> { + val expectedValue = defaultSample.binaryField + assertContentEquals(expectedValue, dynamicSample.getValueList(property.name)[0]) + assertContentEquals(expectedValue, dynamicSample.getValueList(property.name, ByteArray::class)[0]) + } RealmStorageType.OBJECT -> { val expectedValue = defaultSample.stringField assertEquals(expectedValue, dynamicSample.getValueList(property.name)[0].getValue("stringField")) @@ -511,6 +534,8 @@ class DynamicRealmObjectTests { objectListField.add(this) timestampListField.add(defaultSample.timestampField) objectIdListField.add(defaultSample.objectIdField) + uuidListField.add(defaultSample.uuidField) + binaryListField.add(defaultSample.binaryField) nullableStringListField.add(null) nullableByteListField.add(null) @@ -523,6 +548,8 @@ class DynamicRealmObjectTests { nullableDoubleListField.add(null) nullableTimestampListField.add(null) nullableObjectIdListField.add(null) + nullableUUIDListField.add(null) + nullableBinaryListField.add(null) } } } diff --git a/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/nonlatin/NonLatinTests.kt b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/nonlatin/NonLatinTests.kt new file mode 100644 index 0000000000..d89a5b4111 --- /dev/null +++ b/test/base/src/androidTest/kotlin/io/realm/kotlin/test/shared/nonlatin/NonLatinTests.kt @@ -0,0 +1,126 @@ +package io.realm.kotlin.test.shared.nonlatin + +import io.realm.kotlin.Realm +import io.realm.kotlin.RealmConfiguration +import io.realm.kotlin.ext.realmListOf +import io.realm.kotlin.test.platform.PlatformUtils +import io.realm.kotlin.types.RealmList +import io.realm.kotlin.types.RealmObject +import kotlin.test.AfterTest +import kotlin.test.BeforeTest +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertNotNull +import kotlin.test.assertTrue + +class NonLatinFieldNames : RealmObject { + var 베타: String = "베타" // Korean + var Βήτα: String = "Βήτα" // Greek + var ЙйКкЛл: String = "ЙйКкЛл" // Cyrillic + var 山水要: String = "山水要" // Chinese + var ععسنملل: String = "ععسنملل" // Arabic + var `😊🙈`: String = "😊🙈" // Emojii +} + +class NonLatinClassёжф : RealmObject { + var prop: String = "property" + var list: RealmList = realmListOf() + var nullList: RealmList = realmListOf() +} + +class NonLatinTests { + + lateinit var tmpDir: String + lateinit var realm: Realm + + @BeforeTest + fun setup() { + tmpDir = PlatformUtils.createTempDir() + val configuration = + RealmConfiguration.Builder(setOf(NonLatinFieldNames::class, NonLatinClassёжф::class)) + .directory(tmpDir) + .build() + realm = Realm.open(configuration) + } + + @AfterTest + fun tearDown() { + if (!realm.isClosed()) { + realm.close() + } + PlatformUtils.deleteTempDir(tmpDir) + } + + @Test + fun nonLatinClassNames() { + val schema = realm.schema()[NonLatinClassёжф::class.simpleName.toString()]!! + assertEquals(3, schema.properties.size) + assertEquals("NonLatinClassёжф", schema.name) + } + + @Test + fun nonLatinProperties() { + val schema = realm.schema()[NonLatinFieldNames::class.simpleName.toString()]!! + assertEquals(6, schema.properties.size) + assertNotNull(schema[NonLatinFieldNames().베타]) + assertNotNull(schema[NonLatinFieldNames().Βήτα]) + assertNotNull(schema[NonLatinFieldNames().ЙйКкЛл]) + assertNotNull(schema[NonLatinFieldNames().山水要]) + assertNotNull(schema[NonLatinFieldNames().ععسنملل]) + assertNotNull(schema[NonLatinFieldNames().`😊🙈`]) + } + + @Test + fun roundtripNonLatinValues() { + val values = listOf( + "베타", + "Βήτα", + "ЙйКкЛл", + "山水要", + "ععسنملل", + "😊🙈" + ) + + val obj = realm.writeBlocking { + copyToRealm( + NonLatinClassёжф().apply { + list.addAll(values) + nullList.addAll(values) + } + ) + } + assertTrue(obj.list.containsAll(values)) + assertTrue(obj.nullList.containsAll(values)) + } + + // \0 has special semantics both in C++ and in Java, so ensure we can roundtrip + // it correctly. + @Test + fun roundtripNullCharacter() { + val nullChar = "\u0000" + val shortNullString = "foo\u0000bar" + val mediumNullString = "abcdefghijklmnopqrstuvwxyz-\u0000-abcdefghijklmnopqrstuvwxyz" + val obj = realm.writeBlocking { + copyToRealm( + NonLatinClassёжф().apply { + prop = nullChar + list.addAll(listOf(nullChar, shortNullString, mediumNullString)) + nullList.addAll(listOf(nullChar, shortNullString, mediumNullString)) + } + ) + } + + assertEquals(nullChar, obj.prop) + assertEquals(1, obj.prop.length) + + assertEquals(3, obj.list.size) + assertEquals(nullChar, obj.list[0]) + assertEquals(shortNullString, obj.list[1]) + assertEquals(mediumNullString, obj.list[2]) + + assertEquals(3, obj.nullList.size) + assertEquals(nullChar, obj.nullList[0]) + assertEquals(shortNullString, obj.nullList[1]) + assertEquals(mediumNullString, obj.nullList[2]) + } +} diff --git a/test/base/src/commonMain/kotlin/io/realm/kotlin/entities/Nullability.kt b/test/base/src/commonMain/kotlin/io/realm/kotlin/entities/Nullability.kt index ff6305bb5a..86eb1d432b 100644 --- a/test/base/src/commonMain/kotlin/io/realm/kotlin/entities/Nullability.kt +++ b/test/base/src/commonMain/kotlin/io/realm/kotlin/entities/Nullability.kt @@ -19,6 +19,7 @@ package io.realm.kotlin.entities import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.RealmUUID class Nullability : RealmObject { var stringNullable: String? = null @@ -35,5 +36,7 @@ class Nullability : RealmObject { var doubleField: Double? = null var timestampField: RealmInstant? = null var objectIdField: ObjectId? = null + var uuidField: RealmUUID? = null + var binaryField: ByteArray? = null var objectField: Nullability? = null } diff --git a/test/base/src/commonMain/kotlin/io/realm/kotlin/entities/Sample.kt b/test/base/src/commonMain/kotlin/io/realm/kotlin/entities/Sample.kt index 26e17bcebe..844628c784 100644 --- a/test/base/src/commonMain/kotlin/io/realm/kotlin/entities/Sample.kt +++ b/test/base/src/commonMain/kotlin/io/realm/kotlin/entities/Sample.kt @@ -22,6 +22,7 @@ import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmList import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.RealmUUID class Sample : RealmObject { var stringField: String = "Realm" @@ -35,6 +36,8 @@ class Sample : RealmObject { var doubleField: Double = 1.19840122 var timestampField: RealmInstant = RealmInstant.from(100, 1000) var objectIdField: ObjectId = ObjectId.from("507f1f77bcf86cd799439011") + var uuidField: RealmUUID = RealmUUID.from("46423f1b-ce3e-4a7e-812f-004cf9c42d76") + var binaryField: ByteArray = byteArrayOf(42) var nullableStringField: String? = null var nullableByteField: Byte? = null @@ -47,6 +50,8 @@ class Sample : RealmObject { var nullableDoubleField: Double? = null var nullableTimestampField: RealmInstant? = null var nullableObjectIdField: ObjectId? = null + var nullableUUIDField: RealmUUID? = null + var nullableBinaryField: ByteArray? = null var nullableObject: Sample? = null var stringListField: RealmList = realmListOf() @@ -60,6 +65,8 @@ class Sample : RealmObject { var doubleListField: RealmList = realmListOf() var timestampListField: RealmList = realmListOf() var objectIdListField: RealmList = realmListOf() + var uuidListField: RealmList = realmListOf() + var binaryListField: RealmList = realmListOf() var objectListField: RealmList = realmListOf() var nullableStringListField: RealmList = realmListOf() @@ -73,6 +80,8 @@ class Sample : RealmObject { var nullableDoubleListField: RealmList = realmListOf() var nullableTimestampListField: RealmList = realmListOf() var nullableObjectIdListField: RealmList = realmListOf() + var nullableUUIDListField: RealmList = realmListOf() + var nullableBinaryListField: RealmList = realmListOf() // For verification that references inside class is also using our modified accessors and are // not optimized to use the backing field directly. diff --git a/test/base/src/commonMain/kotlin/io/realm/kotlin/entities/list/RealmListContainer.kt b/test/base/src/commonMain/kotlin/io/realm/kotlin/entities/list/RealmListContainer.kt index 2bcc7bc527..061adcad52 100644 --- a/test/base/src/commonMain/kotlin/io/realm/kotlin/entities/list/RealmListContainer.kt +++ b/test/base/src/commonMain/kotlin/io/realm/kotlin/entities/list/RealmListContainer.kt @@ -22,6 +22,7 @@ import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmList import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.RealmUUID import kotlin.reflect.KMutableProperty1 val listTestSchema = setOf(RealmListContainer::class, EmbeddedLevel1::class) @@ -41,6 +42,8 @@ class RealmListContainer : RealmObject { var doubleListField: RealmList = realmListOf() var timestampListField: RealmList = realmListOf() var objectIdListField: RealmList = realmListOf() + var uuidListField: RealmList = realmListOf() + var binaryListField: RealmList = realmListOf() var objectListField: RealmList = realmListOf() var embeddedRealmObjectListField: RealmList = realmListOf() @@ -55,6 +58,8 @@ class RealmListContainer : RealmObject { var nullableDoubleListField: RealmList = realmListOf() var nullableTimestampListField: RealmList = realmListOf() var nullableObjectIdListField: RealmList = realmListOf() + var nullableUUIDListField: RealmList = realmListOf() + var nullableBinaryListField: RealmList = realmListOf() companion object { @@ -71,6 +76,8 @@ class RealmListContainer : RealmObject { Double::class to RealmListContainer::doubleListField as KMutableProperty1>, RealmInstant::class to RealmListContainer::timestampListField as KMutableProperty1>, ObjectId::class to RealmListContainer::objectIdListField as KMutableProperty1>, + RealmUUID::class to RealmListContainer::uuidListField as KMutableProperty1>, + ByteArray::class to RealmListContainer::binaryListField as KMutableProperty1>, RealmObject::class to RealmListContainer::objectListField as KMutableProperty1> ).toMap() @@ -86,7 +93,9 @@ class RealmListContainer : RealmObject { Float::class to RealmListContainer::nullableFloatListField as KMutableProperty1>, Double::class to RealmListContainer::nullableDoubleListField as KMutableProperty1>, RealmInstant::class to RealmListContainer::nullableTimestampListField as KMutableProperty1>, - ObjectId::class to RealmListContainer::nullableObjectIdListField as KMutableProperty1> + ObjectId::class to RealmListContainer::nullableObjectIdListField as KMutableProperty1>, + RealmUUID::class to RealmListContainer::nullableUUIDListField as KMutableProperty1>, + ByteArray::class to RealmListContainer::nullableBinaryListField as KMutableProperty1> ).toMap() } } diff --git a/test/base/src/commonMain/kotlin/io/realm/kotlin/entities/primarykey/PrimaryKey.kt b/test/base/src/commonMain/kotlin/io/realm/kotlin/entities/primarykey/PrimaryKey.kt index 9933177a8b..ae758901dc 100644 --- a/test/base/src/commonMain/kotlin/io/realm/kotlin/entities/primarykey/PrimaryKey.kt +++ b/test/base/src/commonMain/kotlin/io/realm/kotlin/entities/primarykey/PrimaryKey.kt @@ -18,6 +18,7 @@ package io.realm.kotlin.entities.primarykey import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.RealmUUID import io.realm.kotlin.types.annotations.PrimaryKey import kotlin.random.Random import kotlin.random.nextULong @@ -94,3 +95,13 @@ class PrimaryKeyObjectIdNullable : RealmObject { @PrimaryKey var primaryKey: ObjectId? = ObjectId.from("507f191e810c19729de860ea") } + +class PrimaryKeyRealmUUID : RealmObject { + @PrimaryKey + var primaryKey: RealmUUID = RealmUUID.random() +} + +class PrimaryKeyRealmUUIDNullable : RealmObject { + @PrimaryKey + var primaryKey: RealmUUID? = RealmUUID.from("46423f1b-ce3e-4a7e-812f-004cf9c42d76") +} diff --git a/test/base/src/commonMain/kotlin/io/realm/kotlin/entities/schema/SchemaVariations.kt b/test/base/src/commonMain/kotlin/io/realm/kotlin/entities/schema/SchemaVariations.kt index 53d044ae65..98d7a4d1e8 100644 --- a/test/base/src/commonMain/kotlin/io/realm/kotlin/entities/schema/SchemaVariations.kt +++ b/test/base/src/commonMain/kotlin/io/realm/kotlin/entities/schema/SchemaVariations.kt @@ -22,6 +22,7 @@ import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmList import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.RealmUUID import io.realm.kotlin.types.annotations.Index import io.realm.kotlin.types.annotations.PrimaryKey @@ -39,10 +40,14 @@ class SchemaVariations : RealmObject { var long: Long = 5L var float: Float = 5f var double: Double = 5.0 + @PrimaryKey var string: String = "Realm" var date: RealmInstant = RealmInstant.from(0, 0) var objectId: ObjectId = ObjectId.create() + var uuid: RealmUUID = RealmUUID.random() + var binary: ByteArray = byteArrayOf(22, 66) + @Index var nullableString: String? = "Realm" var nullableRealmObject: Sample? = null @@ -59,6 +64,8 @@ class SchemaVariations : RealmObject { var stringList: RealmList = realmListOf() var dateList: RealmList = realmListOf() var objectIdList: RealmList = realmListOf() + var uuidList: RealmList = realmListOf() + var binaryList: RealmList = realmListOf() var objectList: RealmList = realmListOf() diff --git a/test/base/src/commonMain/kotlin/io/realm/kotlin/test/util/TypeDescriptor.kt b/test/base/src/commonMain/kotlin/io/realm/kotlin/test/util/TypeDescriptor.kt index 85eb3a3bb2..7c5b7861ec 100644 --- a/test/base/src/commonMain/kotlin/io/realm/kotlin/test/util/TypeDescriptor.kt +++ b/test/base/src/commonMain/kotlin/io/realm/kotlin/test/util/TypeDescriptor.kt @@ -20,6 +20,7 @@ import io.realm.kotlin.internal.interop.PropertyType import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.RealmUUID import kotlin.reflect.KClass import kotlin.reflect.KClassifier import kotlin.reflect.KMutableProperty1 @@ -120,6 +121,26 @@ public object TypeDescriptor { indexSupport = true, canBeNull = nullabilityForAll, canBeNotNull = nullabilityForAll + ), + UUID( + type = PropertyType.RLM_PROPERTY_TYPE_UUID, + nullable = true, + nonNullable = true, + listSupport = true, + primaryKeySupport = true, + indexSupport = true, + canBeNull = nullabilityForAll, + canBeNotNull = nullabilityForAll + ), + BINARY( + type = PropertyType.RLM_PROPERTY_TYPE_BINARY, + nullable = true, + nonNullable = true, + listSupport = true, + primaryKeySupport = false, + indexSupport = false, + canBeNull = nullabilityForAll, + canBeNotNull = nullabilityForAll ); } @@ -147,6 +168,8 @@ public object TypeDescriptor { String::class to CoreFieldType.STRING, RealmInstant::class to CoreFieldType.TIMESTAMP, ObjectId::class to CoreFieldType.OBJECT_ID, + RealmUUID::class to CoreFieldType.UUID, + ByteArray::class to CoreFieldType.BINARY, RealmObject::class to CoreFieldType.OBJECT ) @@ -167,38 +190,36 @@ public object TypeDescriptor { classifiers: Collection, ): MutableSet { return classifiers.fold( - mutableSetOf(), - { acc, classifier -> - val realmFieldType = TypeDescriptor.classifiers[classifier] - ?: error("Unmapped classifier $classifier") - if (realmFieldType.nullable) { - acc.add(ElementType(classifier, true)) - } - if (realmFieldType.nonNullable) { - acc.add(ElementType(classifier, false)) - } - acc + mutableSetOf() + ) { acc, classifier -> + val realmFieldType = TypeDescriptor.classifiers[classifier] + ?: error("Unmapped classifier $classifier") + if (realmFieldType.nullable) { + acc.add(ElementType(classifier, true)) } - ) + if (realmFieldType.nonNullable) { + acc.add(ElementType(classifier, false)) + } + acc + } } fun elementTypesForList( classifiers: Collection, ): MutableSet { return classifiers.fold( - mutableSetOf(), - { acc, classifier -> - val realmFieldType = TypeDescriptor.classifiers[classifier] - ?: error("Unmapped classifier $classifier") - if (realmFieldType.canBeNull.contains(CollectionType.RLM_COLLECTION_TYPE_LIST)) { - acc.add(ElementType(classifier, true)) - } - if (realmFieldType.canBeNotNull.contains(CollectionType.RLM_COLLECTION_TYPE_LIST)) { - acc.add(ElementType(classifier, false)) - } - acc + mutableSetOf() + ) { acc, classifier -> + val realmFieldType = TypeDescriptor.classifiers[classifier] + ?: error("Unmapped classifier $classifier") + if (realmFieldType.canBeNull.contains(CollectionType.RLM_COLLECTION_TYPE_LIST)) { + acc.add(ElementType(classifier, true)) } - ) + if (realmFieldType.canBeNotNull.contains(CollectionType.RLM_COLLECTION_TYPE_LIST)) { + acc.add(ElementType(classifier, false)) + } + acc + } } // Convenience variables holding collections of the various supported types diff --git a/test/base/src/commonTest/kotlin/io/realm/kotlin/test/NotificationTests.kt b/test/base/src/commonTest/kotlin/io/realm/kotlin/test/NotificationTests.kt index 803bd9534c..f60caae388 100644 --- a/test/base/src/commonTest/kotlin/io/realm/kotlin/test/NotificationTests.kt +++ b/test/base/src/commonTest/kotlin/io/realm/kotlin/test/NotificationTests.kt @@ -35,48 +35,41 @@ interface NotificationTests { // Currently, closing a Realm will not cancel any flows from Realm // @Test - @Ignore // Until proper Realm tracking is in place fun closingRealmDoesNotCancelFlows() - @Test - @Ignore - fun addChangeListener_emitOnProvidedDispatcher() { - // FIXME Implement in another PR - } + // @Test + // fun addChangeListener_emitOnProvidedDispatcher() { + // // FIXME Implement in another PR + // } - @Ignore - @Test - fun addChangeListener() { - // FIXME Implement in another PR - } + // @Test + // fun addChangeListener() { + // // FIXME Implement in another PR + // } - @Test - @Ignore - fun openSameRealmFileWithDifferentDispatchers() { - // FIXME - } + // @Test + // fun openSameRealmFileWithDifferentDispatchers() { + // // FIXME + // } // Verify that the Main dispatcher can be used for both writes and notifications // It should be considered an anti-pattern in production, but is plausible in tests. - @Test - @Ignore - fun useMainDispatchers() { - // FIXME - } + // @Test + // fun useMainDispatchers() { + // // FIXME + // } // Verify that users can use the Main dispatcher for notifications and a background // dispatcher for writes. This is the closest match to how this currently works // in Realm Java. - @Test - @Ignore - fun useMainNotifierDispatcherAndBackgroundWriterDispatcher() { - // FIXME - } + // @Test + // fun useMainNotifierDispatcherAndBackgroundWriterDispatcher() { + // // FIXME + // } // Verify that the special test dispatchers provided by Google also when using Realm. - @Test - @Ignore - fun useTestDispatchers() { - // FIXME - } + // @Test + // fun useTestDispatchers() { + // // FIXME + // } } diff --git a/test/base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/IndexTests.kt b/test/base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/IndexTests.kt index e4dcbbc0da..fc9b4722a5 100644 --- a/test/base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/IndexTests.kt +++ b/test/base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/IndexTests.kt @@ -23,6 +23,7 @@ import io.realm.kotlin.test.util.Compiler.compileFromSource import io.realm.kotlin.test.util.TypeDescriptor.allFieldTypes import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant +import io.realm.kotlin.types.RealmUUID import org.junit.Test import kotlin.reflect.KClassifier import kotlin.test.assertEquals @@ -43,7 +44,9 @@ class IndexTests { Double::class to "1.4", String::class to "\"Realm\"", RealmInstant::class to "RealmInstant.from(42, 420)", - ObjectId::class to "ObjectId.create()" + ObjectId::class to "ObjectId.create()", + RealmUUID::class to "RealmUUID.random()", + ByteArray::class to "byteArrayOf(42)" ) for (type in allFieldTypes) { // TODO Consider adding verification of compiler errors when marking collection @@ -64,6 +67,7 @@ class IndexTests { import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmObject + import io.realm.kotlin.types.RealmUUID import io.realm.kotlin.RealmConfiguration import io.realm.kotlin.types.annotations.Index @@ -81,7 +85,7 @@ class IndexTests { assertEquals(KotlinCompilation.ExitCode.OK, result.exitCode, result.messages) } else { assertEquals(KotlinCompilation.ExitCode.COMPILATION_ERROR, result.exitCode, type.toString()) - assertTrue(result.messages.contains(Regex("sources/indexing.kt: \\(8, 5\\): .*but must be of type"))) + assertTrue(result.messages.contains(Regex("sources/indexing.kt: \\(9, 5\\): .*but must be of type"))) } } } diff --git a/test/base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/PrimaryKeyTests.kt b/test/base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/PrimaryKeyTests.kt index e1d0b2d74a..d9d9203dd2 100644 --- a/test/base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/PrimaryKeyTests.kt +++ b/test/base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/PrimaryKeyTests.kt @@ -23,6 +23,7 @@ import io.realm.kotlin.test.util.Compiler.compileFromSource import io.realm.kotlin.test.util.TypeDescriptor.allFieldTypes import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant +import io.realm.kotlin.types.RealmUUID import org.junit.Test import kotlin.reflect.KClassifier import kotlin.test.assertEquals @@ -45,7 +46,9 @@ class PrimaryKeyTests { Double::class to "1.4", String::class to "\"Realm\"", RealmInstant::class to "RealmInstant.from(42, 420)", - ObjectId::class to "ObjectId.create()" + ObjectId::class to "ObjectId.create()", + RealmUUID::class to "RealmUUID.random()", + ByteArray::class to "byteArrayOf(42)" ) for (type in allFieldTypes) { // TODO Consider adding verification of compiler errors when marking collection @@ -66,6 +69,7 @@ class PrimaryKeyTests { import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmObject + import io.realm.kotlin.types.RealmUUID import io.realm.kotlin.RealmConfiguration import io.realm.kotlin.types.annotations.PrimaryKey diff --git a/test/base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/list/ListTests.kt b/test/base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/list/ListTests.kt index b6fab43be8..6f869afb09 100644 --- a/test/base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/list/ListTests.kt +++ b/test/base/src/jvmTest/kotlin/io/realm/kotlin/test/compiler/list/ListTests.kt @@ -144,6 +144,7 @@ import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmList import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.RealmUUID import java.lang.Exception @@ -158,6 +159,7 @@ import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmList import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.RealmUUID import java.lang.Exception @@ -172,6 +174,7 @@ import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmList import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.RealmUUID import java.lang.Exception @@ -186,6 +189,7 @@ import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmList import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.RealmUUID import java.lang.Exception @@ -200,6 +204,7 @@ private val UNSUPPORTED_TYPE = """ import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmList import io.realm.kotlin.types.RealmObject + import io.realm.kotlin.types.RealmUUID import java.lang.Exception diff --git a/test/sync/build.gradle.kts b/test/sync/build.gradle.kts index 7babb79399..d0c8c776c6 100644 --- a/test/sync/build.gradle.kts +++ b/test/sync/build.gradle.kts @@ -55,7 +55,7 @@ kotlin { dependencies { // TODO AtomicFu doesn't work on the test project due to // https://github.com/Kotlin/kotlinx.atomicfu/issues/90#issuecomment-597872907 - implementation("co.touchlab:stately-concurrency:1.1.7") + implementation("co.touchlab:stately-concurrency:1.2.0") implementation(kotlin("test-common")) implementation(kotlin("test-annotations-common")) implementation("org.jetbrains.kotlinx:kotlinx-datetime:${Versions.datetime}") @@ -161,8 +161,15 @@ kotlin { } kotlin { - iosX64("ios") - macosX64("macos") + // define targets depending on the host platform (Apple or Intel) + if(System.getProperty("os.arch") == "aarch64") { + iosSimulatorArm64("ios") + macosArm64("macos") + } else if(System.getProperty("os.arch") == "x86_64") { + iosX64("ios") + macosX64("macos") + } + sourceSets { val macosMain by getting val macosTest by getting diff --git a/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/SyncClientResetIntegrationJVMTests.kt b/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/SyncClientResetIntegrationJVMTests.kt index 3754ff33d8..f1ec9befb9 100644 --- a/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/SyncClientResetIntegrationJVMTests.kt +++ b/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/SyncClientResetIntegrationJVMTests.kt @@ -20,6 +20,8 @@ package io.realm.kotlin.test import io.realm.kotlin.MutableRealm import io.realm.kotlin.Realm import io.realm.kotlin.TypedRealm +import io.realm.kotlin.entities.sync.flx.FlexChildObject +import io.realm.kotlin.entities.sync.flx.FlexEmbeddedObject import io.realm.kotlin.entities.sync.flx.FlexParentObject import io.realm.kotlin.internal.platform.runBlocking import io.realm.kotlin.log.LogLevel @@ -81,7 +83,7 @@ class SyncClientResetIntegrationJVMTests { val config = SyncConfiguration.Builder( user, partitionValue, - schema = setOf(FlexParentObject::class) // Use a class that is present in the server schema + schema = setOf(FlexParentObject::class, FlexChildObject::class, FlexEmbeddedObject::class) // Use a class that is present in the server schema ).syncClientResetStrategy( object : DiscardUnsyncedChangesStrategy { override fun onBeforeReset(realm: TypedRealm) { @@ -132,7 +134,7 @@ class SyncClientResetIntegrationJVMTests { val config = SyncConfiguration.Builder( user, partitionValue, - schema = setOf(FlexParentObject::class) // Use a class that is present in the server schema + schema = setOf(FlexParentObject::class, FlexChildObject::class, FlexEmbeddedObject::class) // Use a class that is present in the server schema ).syncClientResetStrategy( object : DiscardUnsyncedChangesStrategy { override fun onBeforeReset(realm: TypedRealm) { diff --git a/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/FlexibleSyncIntegrationTests.kt b/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/FlexibleSyncIntegrationTests.kt index 85e5e2d8d7..8da60bccf1 100644 --- a/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/FlexibleSyncIntegrationTests.kt +++ b/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/FlexibleSyncIntegrationTests.kt @@ -18,6 +18,7 @@ package io.realm.kotlin.test.mongodb.shared import io.realm.kotlin.Realm import io.realm.kotlin.entities.sync.flx.FlexChildObject +import io.realm.kotlin.entities.sync.flx.FlexEmbeddedObject import io.realm.kotlin.entities.sync.flx.FlexParentObject import io.realm.kotlin.ext.query import io.realm.kotlin.internal.platform.runBlocking @@ -49,7 +50,7 @@ import kotlin.time.Duration.Companion.seconds */ class FlexibleSyncIntegrationTests { - private val defaultSchema = setOf(FlexParentObject::class, FlexChildObject::class) + private val defaultSchema = setOf(FlexParentObject::class, FlexChildObject::class, FlexEmbeddedObject::class) private lateinit var app: TestApp @BeforeTest @@ -164,7 +165,7 @@ class FlexibleSyncIntegrationTests { @Test fun initialSubscriptions_timeOut() { - val config = SyncConfiguration.Builder(app.currentUser!!, setOf(FlexParentObject::class, FlexChildObject::class)) + val config = SyncConfiguration.Builder(app.currentUser!!, defaultSchema) .initialSubscriptions { realm -> repeat(10) { add(realm.query("section = $0", it)) @@ -229,4 +230,74 @@ class FlexibleSyncIntegrationTests { assertEquals(2, realm.query().count().find()) } } + + @Suppress("LongMethod") + @Test + fun roundtripLinkedAndEmbeddedObjects() = runBlocking { + val randomSection = Random.nextInt() // Generate random name to allow replays of unit tests + + // Upload data from user 1 + val user1 = app.createUserAndLogIn(TestHelper.randomEmail(), "123456") + val config1 = SyncConfiguration.create(user1, defaultSchema) + Realm.open(config1).use { realm1 -> + val subs = realm1.subscriptions.update { + add(realm1.query("section = $0", randomSection)) + add(realm1.query("section = $0", randomSection)) + } + assertTrue(subs.waitForSynchronization()) + realm1.write { + copyToRealm( + FlexParentObject(randomSection).apply { + name = "red" + child = FlexChildObject().apply { + section = randomSection + name = "redChild" + } + embedded = FlexEmbeddedObject().apply { + embeddedName = "redEmbedded" + } + } + ) + copyToRealm( + FlexParentObject(randomSection).apply { + name = "blue" + child = FlexChildObject().apply { + section = randomSection + name = "blueChild" + } + embedded = FlexEmbeddedObject().apply { + embeddedName = "blueEmbedded" + } + } + ) + } + realm1.syncSession.uploadAllLocalChanges() + } + + // Download data from user 2 + val user2 = app.createUserAndLogIn(TestHelper.randomEmail(), "123456") + val config2 = SyncConfiguration.Builder(user2, defaultSchema) + .initialSubscriptions { realm -> + add( + realm.query( + "section = $0 AND name = $1", + randomSection, + "blue" + ) + ) + add(realm.query("section = $0", randomSection)) + } + .waitForInitialRemoteData(timeout = 1.minutes) + .build() + + Realm.open(config2).use { realm2 -> + assertEquals(1, realm2.query().count().find()) + assertEquals(2, realm2.query().count().find()) + // Embedded objects are pulled down as part of their parents + assertEquals(1, realm2.query().count().find()) + val obj = realm2.query().first().find()!! + assertEquals("blueChild", obj.child!!.name) + assertEquals("blueEmbedded", obj.embedded!!.embeddedName) + } + } } diff --git a/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/MutableSubscriptionSetTests.kt b/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/MutableSubscriptionSetTests.kt index 1276311bd5..fd162900e1 100644 --- a/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/MutableSubscriptionSetTests.kt +++ b/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/MutableSubscriptionSetTests.kt @@ -18,6 +18,7 @@ package io.realm.kotlin.test.mongodb.shared import io.realm.kotlin.Realm import io.realm.kotlin.entities.sync.flx.FlexChildObject +import io.realm.kotlin.entities.sync.flx.FlexEmbeddedObject import io.realm.kotlin.entities.sync.flx.FlexParentObject import io.realm.kotlin.ext.query import io.realm.kotlin.internal.platform.runBlocking @@ -60,7 +61,7 @@ class MutableSubscriptionSetTests { } config = SyncConfiguration.Builder( user, - schema = setOf(FlexParentObject::class, FlexChildObject::class) + schema = setOf(FlexParentObject::class, FlexChildObject::class, FlexEmbeddedObject::class) ) .build() realm = Realm.open(config) diff --git a/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/SubscriptionSetTests.kt b/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/SubscriptionSetTests.kt index c17ed49064..f820a684d7 100644 --- a/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/SubscriptionSetTests.kt +++ b/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/SubscriptionSetTests.kt @@ -17,6 +17,7 @@ package io.realm.kotlin.test.mongodb.shared import io.realm.kotlin.Realm import io.realm.kotlin.entities.sync.flx.FlexChildObject +import io.realm.kotlin.entities.sync.flx.FlexEmbeddedObject import io.realm.kotlin.entities.sync.flx.FlexParentObject import io.realm.kotlin.ext.query import io.realm.kotlin.internal.platform.runBlocking @@ -62,7 +63,7 @@ class SubscriptionSetTests { } val config = SyncConfiguration.Builder( user, - schema = setOf(FlexParentObject::class, FlexChildObject::class) + schema = setOf(FlexParentObject::class, FlexChildObject::class, FlexEmbeddedObject::class) ) .build() realm = Realm.open(config) @@ -96,7 +97,7 @@ class SubscriptionSetTests { val config = SyncConfiguration.create( user, TestHelper.randomPartitionValue(), - setOf(FlexParentObject::class, FlexChildObject::class) + setOf(FlexParentObject::class, FlexChildObject::class, FlexEmbeddedObject::class) ) Realm.open(config).use { partionBasedRealm -> assertFailsWith { partionBasedRealm.subscriptions } diff --git a/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/SyncConfigTests.kt b/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/SyncConfigTests.kt index a78f21bc08..3812857a0c 100644 --- a/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/SyncConfigTests.kt +++ b/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/SyncConfigTests.kt @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +@file:Suppress("invisible_member", "invisible_reference") // Needed to call session.simulateError() package io.realm.kotlin.test.mongodb.shared @@ -21,8 +22,12 @@ import io.realm.kotlin.InitialDataCallback import io.realm.kotlin.MutableRealm import io.realm.kotlin.Realm import io.realm.kotlin.TypedRealm +import io.realm.kotlin.dynamic.DynamicRealmObject import io.realm.kotlin.entities.sync.ChildPk import io.realm.kotlin.entities.sync.ParentPk +import io.realm.kotlin.entities.sync.flx.FlexChildObject +import io.realm.kotlin.entities.sync.flx.FlexEmbeddedObject +import io.realm.kotlin.entities.sync.flx.FlexParentObject import io.realm.kotlin.ext.query import io.realm.kotlin.internal.platform.createDefaultSystemLogger import io.realm.kotlin.internal.platform.runBlocking @@ -34,9 +39,11 @@ import io.realm.kotlin.mongodb.exceptions.ClientResetRequiredException import io.realm.kotlin.mongodb.exceptions.SyncException import io.realm.kotlin.mongodb.sync.DiscardUnsyncedChangesStrategy import io.realm.kotlin.mongodb.sync.ManuallyRecoverUnsyncedChangesStrategy +import io.realm.kotlin.mongodb.sync.PartitionValue.ValueType import io.realm.kotlin.mongodb.sync.SyncConfiguration import io.realm.kotlin.mongodb.sync.SyncMode import io.realm.kotlin.mongodb.sync.SyncSession +import io.realm.kotlin.test.assertFailsWithMessage import io.realm.kotlin.test.mongodb.TestApp import io.realm.kotlin.test.mongodb.asTestApp import io.realm.kotlin.test.mongodb.createUserAndLogIn @@ -44,9 +51,13 @@ import io.realm.kotlin.test.util.TestHelper import io.realm.kotlin.test.util.TestHelper.getRandomKey import io.realm.kotlin.test.util.TestHelper.randomEmail import io.realm.kotlin.test.util.use +import io.realm.kotlin.types.ObjectId +import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.RealmUUID import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.withContext import kotlin.random.Random +import kotlin.reflect.KClass import kotlin.test.AfterTest import kotlin.test.BeforeTest import kotlin.test.Ignore @@ -314,26 +325,83 @@ class SyncConfigTests { } @Test - fun nullPartitionValue() { + fun allPartitionTypes() { val user: User = createTestUser() - val configs = listOf( - SyncConfiguration.create(user, null as String?, setOf()), - SyncConfiguration.create(user, null as Int?, setOf()), - SyncConfiguration.create(user, null as Long?, setOf()), - // SyncConfiguration.create(user, null as ObjectId?), - // SyncConfiguration.create(user, null as UUID?), - SyncConfiguration.Builder(user, null as String?, setOf()).build(), - SyncConfiguration.Builder(user, null as Int?, setOf()).build(), - SyncConfiguration.Builder(user, null as Long?, setOf()).build(), - // SyncConfiguration.Builder(user, null as ObjectId?).build() - // SyncConfiguration.Builder(user, null as UUID?).build() - ) - configs.forEach { config -> - assertTrue(config.path.endsWith("/null.realm"), "${config.path} failed") + val partitionsAndRealmNames: Map = + enumValues().flatMap { valueType -> + when (valueType) { + ValueType.STRING -> listOf( + "string" to "s_string", + null as String? to "null" + ) + + ValueType.INT -> listOf( + 10.toInt() to "i_10", + null as Int? to "null", + ) + + ValueType.LONG -> listOf( + 20.toLong() to "l_20", + null as Long? to "null" + ) + + ValueType.OBJECT_ID -> listOf( + ObjectId.from("62aafc72b9c357695ac489a7") to "o_62aafc72b9c357695ac489a7", + null as ObjectId? to "null", + ) + + ValueType.UUID -> listOf( + RealmUUID.from("80ac3926-29a4-4315-b373-2e2a33cf694f") to "u_80ac3926-29a4-4315-b373-2e2a33cf694f", + null as RealmUUID? to "null", + ) + + ValueType.NULL -> listOf( + null to "null" + ) + else -> TODO("Test for partition type not defined") + } + }.toMap() + + // Validate SyncConfiguration.create + partitionsAndRealmNames.forEach { (partition: Any?, name: String) -> + val config = createWithGenericPartition(user, partition, setOf()) + assertTrue(config.path.endsWith("/$name.realm"), "${config.path} failed") + } + + // Validate SyncConfiguration.Builder + partitionsAndRealmNames.forEach { (partition: Any?, name: String) -> + val config = createBuilderWithGenericPartition(user, partition, setOf()) + assertTrue(config.path.endsWith("/$name.realm"), "${config.path} failed") } } + fun createWithGenericPartition( + user: User, + partitionValue: Any?, + schema: Set> + ) = when (partitionValue) { + is String? -> SyncConfiguration.create(user, partitionValue, schema) + is Int? -> SyncConfiguration.create(user, partitionValue, schema) + is Long? -> SyncConfiguration.create(user, partitionValue, schema) + is ObjectId? -> SyncConfiguration.create(user, partitionValue, schema) + is RealmUUID? -> SyncConfiguration.create(user, partitionValue, schema) + else -> TODO("Undefined partition type") + } + + fun createBuilderWithGenericPartition( + user: User, + partitionValue: Any?, + schema: Set> + ) = when (partitionValue) { + is String? -> SyncConfiguration.Builder(user, partitionValue, schema).build() + is Int? -> SyncConfiguration.Builder(user, partitionValue, schema).build() + is Long? -> SyncConfiguration.Builder(user, partitionValue, schema).build() + is ObjectId? -> SyncConfiguration.Builder(user, partitionValue, schema).build() + is RealmUUID? -> SyncConfiguration.Builder(user, partitionValue, schema).build() + else -> TODO("Undefined partition type") + } + @Test fun name_withoutFileExtension() { nameAssertions("my-file-name") @@ -498,6 +566,95 @@ class SyncConfigTests { assertEquals(10.seconds, config.initialRemoteData!!.timeout) } + @Suppress("invisible_member", "invisible_reference") + @Test + fun supportedSchemaTypesWhenCreatingSyncConfiguration_partitionBased() { + val user = createTestUser() + val supportedSchemaTypes = setOf( + FlexParentObject::class, + FlexChildObject::class, + FlexEmbeddedObject::class, + ) + + val validateConfig = { config: io.realm.kotlin.Configuration -> + assertEquals(3, config.schema.size) + } + + // Partition-based Sync + enumValues().forEach { + when (it) { + ValueType.STRING -> { + validateConfig(SyncConfiguration.create(user, "", supportedSchemaTypes)) + validateConfig(SyncConfiguration.Builder(user, "", supportedSchemaTypes).build()) + } + ValueType.INT -> { + validateConfig(SyncConfiguration.create(user, 1 as Int, supportedSchemaTypes)) + validateConfig(SyncConfiguration.Builder(user, 1 as Int, supportedSchemaTypes).build()) + } + ValueType.LONG -> { + validateConfig(SyncConfiguration.create(user, 1L, supportedSchemaTypes)) + validateConfig(SyncConfiguration.Builder(user, 1L, supportedSchemaTypes).build()) + } + ValueType.OBJECT_ID -> { + validateConfig(SyncConfiguration.create(user, ObjectId.create(), supportedSchemaTypes)) + validateConfig(SyncConfiguration.Builder(user, ObjectId.create(), supportedSchemaTypes).build()) + } + ValueType.UUID -> { + validateConfig(SyncConfiguration.create(user, RealmUUID.random(), supportedSchemaTypes)) + validateConfig(SyncConfiguration.Builder(user, RealmUUID.random(), supportedSchemaTypes).build()) + } + ValueType.NULL -> { + validateConfig(SyncConfiguration.create(user, null as String?, supportedSchemaTypes)) + validateConfig(SyncConfiguration.Builder(user, null as String?, supportedSchemaTypes).build()) + } + else -> TODO("Test for partition type not defined") + } + } + } + + @Suppress("invisible_member", "invisible_reference") + @Test + fun supportedSchemaTypesWhenCreatingSyncConfiguration_flexibleSync() { + val user = createTestUser() + val supportedSchemaTypes = setOf( + FlexParentObject::class, + FlexChildObject::class, + FlexEmbeddedObject::class, + ) + + val validateConfig = { config: io.realm.kotlin.Configuration -> + assertEquals(3, config.schema.size) + } + + // Flexible Sync + validateConfig(SyncConfiguration.create(user, supportedSchemaTypes)) + validateConfig(SyncConfiguration.Builder(user, supportedSchemaTypes).build()) + } + + @Test + fun unsupportedSchemaTypesThrowException_partitionBasedSync() { + val user = createTestUser() + val unsupportedSchemaType = setOf(DynamicRealmObject::class) + assertFailsWithMessage(IllegalArgumentException::class, "Only subclasses of RealmObject and EmbeddedRealmObject are allowed in the schema. Found: io.realm.kotlin.dynamic.DynamicRealmObject") { + SyncConfiguration.create(user, "", unsupportedSchemaType) + } + assertFailsWithMessage(IllegalArgumentException::class, "Only subclasses of RealmObject and EmbeddedRealmObject are allowed in the schema. Found: io.realm.kotlin.dynamic.DynamicRealmObject") { + SyncConfiguration.Builder(user, "", unsupportedSchemaType) + } + } + + @Test + fun unsupportedSchemaTypesThrowException_flexibleSync() { + val user = createTestUser() + val unsupportedSchemaType = setOf(DynamicRealmObject::class) + assertFailsWithMessage(IllegalArgumentException::class, "Only subclasses of RealmObject and EmbeddedRealmObject are allowed in the schema. Found: io.realm.kotlin.dynamic.DynamicRealmObject") { + SyncConfiguration.create(user, unsupportedSchemaType) + } + assertFailsWithMessage(IllegalArgumentException::class, "Only subclasses of RealmObject and EmbeddedRealmObject are allowed in the schema. Found: io.realm.kotlin.dynamic.DynamicRealmObject") { + SyncConfiguration.Builder(user, unsupportedSchemaType) + } + } + // // @Test // @Ignore("Not implemented yet") diff --git a/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/SyncSessionTests.kt b/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/SyncSessionTests.kt index be49d7b5a9..2a05f4880e 100644 --- a/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/SyncSessionTests.kt +++ b/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/SyncSessionTests.kt @@ -20,6 +20,7 @@ import io.realm.kotlin.MutableRealm import io.realm.kotlin.Realm import io.realm.kotlin.RealmConfiguration import io.realm.kotlin.TypedRealm +import io.realm.kotlin.entities.sync.BinaryObject import io.realm.kotlin.entities.sync.ChildPk import io.realm.kotlin.entities.sync.ObjectIdPk import io.realm.kotlin.entities.sync.ParentPk @@ -200,7 +201,13 @@ class SyncSessionTests { @Test fun downloadAllServerChanges_returnFalseOnTimeOut() { - openSyncRealm { realm -> + openSyncRealmWithPreconditions({ realm -> + // Write a large ByteArray so that we increase the chance the timeout works + realm.writeBlocking { + val obj = BinaryObject() + copyToRealm(obj) + } + }) { realm -> val session = realm.syncSession assertFalse(session.downloadAllServerChanges(timeout = 1.nanoseconds)) } @@ -221,7 +228,13 @@ class SyncSessionTests { @Test fun uploadAllLocalChanges_returnFalseOnTimeOut() { - openSyncRealm { realm -> + openSyncRealmWithPreconditions({ realm -> + // Write a large ByteArray so that we increase the chance the timeout works + realm.writeBlocking { + val obj = BinaryObject() + copyToRealm(obj) + } + }) { realm -> val session = realm.syncSession assertFalse(session.uploadAllLocalChanges(timeout = 1.nanoseconds)) } @@ -478,12 +491,24 @@ class SyncSessionTests { } } - private fun openSyncRealm(block: suspend (Realm) -> Unit) { + private fun openSyncRealmWithPreconditions( + preconditions: (suspend (Realm) -> Unit)? = null, + block: suspend (Realm) -> Unit + ) { val config = SyncConfiguration.Builder( user, partitionValue, - schema = setOf(ParentPk::class, ChildPk::class) + schema = setOf(ParentPk::class, ChildPk::class, BinaryObject::class) ).build() + + if (preconditions != null) { + Realm.open(config).use { realm -> + runBlocking { + preconditions(realm) + } + } + } + Realm.open(config).use { realm -> runBlocking { block(realm) @@ -491,6 +516,10 @@ class SyncSessionTests { } } + private fun openSyncRealm(block: suspend (Realm) -> Unit) { + openSyncRealmWithPreconditions(null, block) + } + @Suppress("LongParameterList") private fun createSyncConfig( user: User, diff --git a/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/UserTests.kt b/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/UserTests.kt index a5e4ff8087..901b937ecd 100644 --- a/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/UserTests.kt +++ b/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/UserTests.kt @@ -16,12 +16,17 @@ package io.realm.kotlin.test.mongodb.shared +import io.realm.kotlin.Realm +import io.realm.kotlin.entities.sync.SyncObjectWithAllTypes +import io.realm.kotlin.internal.platform.fileExists import io.realm.kotlin.internal.platform.runBlocking import io.realm.kotlin.mongodb.App import io.realm.kotlin.mongodb.Credentials import io.realm.kotlin.mongodb.User +import io.realm.kotlin.mongodb.sync.SyncConfiguration import io.realm.kotlin.test.mongodb.TestApp import io.realm.kotlin.test.mongodb.asTestApp +import io.realm.kotlin.test.util.TestHelper import io.realm.kotlin.test.util.TestHelper.randomEmail import kotlin.test.AfterTest import kotlin.test.BeforeTest @@ -297,6 +302,57 @@ class UserTests { } } + @Test + fun deleteUser() { + runBlocking { + val user1 = createUserAndLogin() + val config = SyncConfiguration.create( + user1, + TestHelper.randomPartitionValue(), + setOf(SyncObjectWithAllTypes::class) + ) + Realm.open(config).close() + assertTrue(fileExists(config.path)) + assertEquals(user1, app.currentUser) + assertEquals(1, app.allUsers().size) + user1.delete() + assertEquals(User.State.REMOVED, user1.state) + assertNull(app.currentUser) + assertEquals(0, app.allUsers().size) + assertFalse(fileExists(config.path)) + } + } + + @Test + fun deleteUser_loggedOutThrows() { + runBlocking { + val user1 = createUserAndLogin() + val config = SyncConfiguration.create( + user1, + TestHelper.randomPartitionValue(), + setOf(SyncObjectWithAllTypes::class) + ) + Realm.open(config).close() + user1.logOut() + assertTrue(fileExists(config.path)) + assertFailsWith { + user1.delete() + } + assertTrue(fileExists(config.path)) + } + } + + @Test + fun deleteUser_throwsIfUserAlreadyDeleted() { + runBlocking { + val user1 = createUserAndLogin() + user1.delete() + assertFailsWith { + user1.delete() + } + } + } + // @Test // fun getApiKeyAuthProvider() { // val user: User = app.registerUserAndLogin(TestHelper.getRandomEmail(), "123456") diff --git a/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/nonlatin/NonLatinTests.kt b/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/nonlatin/NonLatinTests.kt new file mode 100644 index 0000000000..a38aea1b5c --- /dev/null +++ b/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/mongodb/shared/nonlatin/NonLatinTests.kt @@ -0,0 +1,92 @@ +package io.realm.kotlin.test.mongodb.shared.nonlatin + +import io.realm.kotlin.Realm +import io.realm.kotlin.entities.sync.ObjectIdPk +import io.realm.kotlin.ext.query +import io.realm.kotlin.internal.platform.runBlocking +import io.realm.kotlin.mongodb.User +import io.realm.kotlin.mongodb.sync.SyncConfiguration +import io.realm.kotlin.test.mongodb.TestApp +import io.realm.kotlin.test.mongodb.asTestApp +import io.realm.kotlin.test.mongodb.createUserAndLogIn +import io.realm.kotlin.test.util.TestHelper +import io.realm.kotlin.types.ObjectId +import kotlinx.coroutines.async +import kotlinx.coroutines.channels.Channel +import kotlinx.serialization.json.JsonObject +import kotlinx.serialization.json.jsonPrimitive +import kotlin.test.AfterTest +import kotlin.test.BeforeTest +import kotlin.test.Test +import kotlin.test.assertContentEquals +import kotlin.test.assertEquals +import kotlin.test.assertNotNull + +class NonLatinTests { + + private lateinit var partitionValue: String + private lateinit var user: User + private lateinit var app: TestApp + + @BeforeTest + fun setup() { + partitionValue = TestHelper.randomPartitionValue() + app = TestApp() + val (email, password) = TestHelper.randomEmail() to "password1234" + user = runBlocking { + app.createUserAndLogIn(email, password) + } + } + + @AfterTest + fun tearDown() { + if (this::app.isInitialized) { + app.close() + } + } + + /** + * - Insert a string with the null character in MongoDB using the command server + */ + @Test + fun readNullCharacterFromMongoDB() { + val adminApi = app.asTestApp + runBlocking { + val config = + SyncConfiguration.Builder(user, partitionValue, schema = setOf(ObjectIdPk::class)) + .build() + val realm = Realm.open(config) + + val json: JsonObject = adminApi.insertDocument( + ObjectIdPk::class.simpleName!!, + """ + { + "name": "foo\u0000bar", + "realm_id" : "$partitionValue" + } + """.trimIndent() + ) + val oid = json["insertedId"]?.jsonPrimitive?.content + assertNotNull(oid) + + val channel = Channel(1) + val job = async { + realm.query("_id = $0", ObjectId.from(oid)).first() + .asFlow().collect { + if (it.obj != null) { + channel.trySend(it.obj!!) + } + } + } + + val insertedObject = channel.receive() + assertEquals(oid, insertedObject._id.toString()) + val char1 = "foo\u0000bar".toCharArray() + val char2 = insertedObject.name.toCharArray() + assertEquals("foo\u0000bar", insertedObject.name) + assertContentEquals(char1, char2) + realm.close() + job.cancel() + } + } +} diff --git a/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/shared/SyncedRealmTests.kt b/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/shared/SyncedRealmTests.kt index 26bbe77d4c..8d75d14486 100644 --- a/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/shared/SyncedRealmTests.kt +++ b/test/sync/src/androidTest/kotlin/io/realm/kotlin/test/shared/SyncedRealmTests.kt @@ -18,10 +18,14 @@ package io.realm.kotlin.test.shared import io.realm.kotlin.LogConfiguration import io.realm.kotlin.Realm +import io.realm.kotlin.RealmConfiguration import io.realm.kotlin.VersionId import io.realm.kotlin.entities.sync.ChildPk import io.realm.kotlin.entities.sync.ParentPk import io.realm.kotlin.entities.sync.SyncObjectWithAllTypes +import io.realm.kotlin.entities.sync.flx.FlexChildObject +import io.realm.kotlin.entities.sync.flx.FlexEmbeddedObject +import io.realm.kotlin.entities.sync.flx.FlexParentObject import io.realm.kotlin.ext.query import io.realm.kotlin.internal.platform.fileExists import io.realm.kotlin.internal.platform.freeze @@ -30,6 +34,7 @@ import io.realm.kotlin.mongodb.App import io.realm.kotlin.mongodb.User import io.realm.kotlin.mongodb.exceptions.DownloadingRealmTimeOutException import io.realm.kotlin.mongodb.exceptions.SyncException +import io.realm.kotlin.mongodb.exceptions.UnrecoverableSyncException import io.realm.kotlin.mongodb.sync.SyncConfiguration import io.realm.kotlin.mongodb.sync.SyncSession import io.realm.kotlin.mongodb.sync.SyncSession.ErrorHandler @@ -39,13 +44,16 @@ import io.realm.kotlin.test.mongodb.TestApp import io.realm.kotlin.test.mongodb.asTestApp import io.realm.kotlin.test.mongodb.createUserAndLogIn import io.realm.kotlin.test.mongodb.shared.DEFAULT_NAME +import io.realm.kotlin.test.mongodb.util.SyncPermissions +import io.realm.kotlin.test.platform.PlatformUtils import io.realm.kotlin.test.util.TestHelper import io.realm.kotlin.test.util.TestHelper.randomEmail import io.realm.kotlin.test.util.use -import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.BaseRealmObject import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.async import kotlinx.coroutines.channels.Channel +import kotlinx.coroutines.delay import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.first import kotlinx.coroutines.flow.map @@ -69,7 +77,9 @@ import kotlin.test.assertNotNull import kotlin.test.assertTrue import kotlin.test.fail import kotlin.time.Duration.Companion.nanoseconds +import kotlin.time.Duration.Companion.seconds +@Suppress("LargeClass") class SyncedRealmTests { companion object { @@ -231,6 +241,43 @@ class SyncedRealmTests { realm3.close() } + @Test + fun errorHandlerReceivesPermissionDeniedSyncError() { + val channel = Channel(1).freeze() + val (email, password) = randomEmail() to "password1234" + val user = runBlocking { + app.createUserAndLogIn(email, password) + } + + val config = SyncConfiguration.Builder( + schema = setOf(ParentPk::class, ChildPk::class), + user = user, + partitionValue = partitionValue + ).errorHandler { _, error -> + channel.trySend(error) + }.build() + + // Remove permissions to generate a sync error containing ONLY the original path + // This way we assert we don't read wrong data from the user_info field + runBlocking { + app.asTestApp.changeSyncPermissions(SyncPermissions(read = false, write = false)) { + runBlocking { + val deferred = async { Realm.open(config) } + + val error = channel.receive() + assertTrue(error is UnrecoverableSyncException) + val message = error.message + assertNotNull(message) + assertTrue( + message.toLowerCase().contains("permission denied"), + "The error should be 'PermissionDenied' but it was: $message" + ) + deferred.cancel() + } + } + } + } + @Test fun testErrorHandler() { // Open a realm with a schema. Close it without doing anything else @@ -279,7 +326,10 @@ class SyncedRealmTests { assertTrue(errorMessage.contains("Bad changeset (DOWNLOAD)"), errorMessage) } else if (errorMessage.contains("[Session]")) { assertTrue(errorMessage.contains("InvalidSchemaChange(225)"), errorMessage) - assertTrue(errorMessage.contains("Invalid schema change (UPLOAD)"), errorMessage) + assertTrue( + errorMessage.contains("Invalid schema change (UPLOAD)"), + errorMessage + ) } else { fail("Unexpected error message: $errorMessage") } @@ -297,7 +347,7 @@ class SyncedRealmTests { @Ignore fun waitForInitialRemoteData_mainThreadThrows() = runBlocking(Dispatchers.Main) { val user = app.asTestApp.createUserAndLogin() - val config: SyncConfiguration = SyncConfiguration.Builder(user, TestHelper.randomPartitionValue(), setOf()) + val config = SyncConfiguration.Builder(user, TestHelper.randomPartitionValue(), setOf()) .waitForInitialRemoteData() .build() assertFailsWith { @@ -430,8 +480,10 @@ class SyncedRealmTests { fun deleteRealm() { val fileSystem = FileSystem.SYSTEM val user = app.asTestApp.createUserAndLogin() - val configuration: SyncConfiguration = SyncConfiguration.create(user, partitionValue, setOf()) - val syncDir: Path = "${app.configuration.syncRootDirectory}/mongodb-realm/${app.configuration.appId}/${user.identity}".toPath() + val configuration: SyncConfiguration = + SyncConfiguration.create(user, partitionValue, setOf()) + val syncDir: Path = + "${app.configuration.syncRootDirectory}/mongodb-realm/${app.configuration.appId}/${user.identity}".toPath() val bgThreadReadyChannel = Channel(1) val readyToCloseChannel = Channel(1) @@ -507,17 +559,285 @@ class SyncedRealmTests { schema = setOf(SyncObjectWithAllTypes::class) ).let { config -> Realm.open(config).use { realm -> - val obj: SyncObjectWithAllTypes = realm.query("_id = $0", id) - .asFlow() - .first { - it.list.size == 1 - } - .list.first() + val obj: SyncObjectWithAllTypes = + realm.query("_id = $0", id) + .asFlow() + .first { + it.list.size == 1 + }.list.first() assertTrue(SyncObjectWithAllTypes.compareAgainstSampleData(obj)) } } } + private fun createWriteCopyLocalConfig(name: String, encryptionKey: ByteArray? = null): RealmConfiguration { + val builder = RealmConfiguration.Builder( + schema = setOf( + SyncObjectWithAllTypes::class, + FlexParentObject::class, + FlexChildObject::class, + FlexEmbeddedObject::class + ) + ) + .directory(PlatformUtils.createTempDir()) + .name(name) + if (encryptionKey != null) { + builder.encryptionKey(encryptionKey) + } + return builder.build() + } + + @Test + fun writeCopyTo_localToPartitionBasedSync() = runBlocking { + val (email1, password1) = randomEmail() to "password1234" + val (email2, password2) = randomEmail() to "password1234" + val user1 = app.createUserAndLogIn(email1, password1) + val user2 = app.createUserAndLogIn(email2, password2) + val localConfig = createWriteCopyLocalConfig("local.realm") + val partitionValue = TestHelper.randomPartitionValue() + val syncConfig1 = createSyncConfig( + user = user1, + name = "sync1.realm", + partitionValue = partitionValue, + schema = setOf(SyncObjectWithAllTypes::class) + ) + val syncConfig2 = createSyncConfig( + user = user2, + name = "sync2.realm", + partitionValue = partitionValue, + schema = setOf(SyncObjectWithAllTypes::class) + ) + Realm.open(localConfig).use { localRealm -> + localRealm.writeBlocking { + copyToRealm( + SyncObjectWithAllTypes().apply { + stringField = "local object" + } + ) + } + // Copy to partition-based Realm + localRealm.writeCopyTo(syncConfig1) + } + // Open Sync Realm and ensure that data can be used and uploaded + Realm.open(syncConfig1).use { syncRealm1: Realm -> + assertEquals(1, syncRealm1.query().count().find()) + assertEquals("local object", syncRealm1.query().first().find()!!.stringField) + syncRealm1.writeBlocking { + query().first().find()!!.apply { + stringField = "updated local object" + } + } + } + // Check that uploaded data can be used + Realm.open(syncConfig2).use { syncRealm2: Realm -> + val obj = syncRealm2.query().asFlow() + .first { it.list.size == 1 } + .list + .first() + assertEquals("updated local object", obj.stringField) + } + } + + @Test + fun writeCopyTo_localToFlexibleSync_throws() = runBlocking { + val flexApp = TestApp(appName = io.realm.kotlin.test.mongodb.TEST_APP_FLEX) + val (email1, password1) = randomEmail() to "password1234" + val user1 = flexApp.createUserAndLogIn(email1, password1) + val localConfig = createWriteCopyLocalConfig("local.realm") + val flexSyncConfig = createFlexibleSyncConfig( + user = user1, + schema = setOf(FlexParentObject::class, FlexChildObject::class, FlexEmbeddedObject::class) + ) + Realm.open(localConfig).use { localRealm -> + localRealm.writeBlocking { + copyToRealm( + SyncObjectWithAllTypes().apply { + stringField = "local object" + } + ) + } + assertFailsWith { + localRealm.writeCopyTo(flexSyncConfig) + } + } + } + + @Test + fun writeCopyTo_partitionBasedToLocal() = runBlocking { + val (email, password) = randomEmail() to "password1234" + val user = app.createUserAndLogIn(email, password) + val localConfig = createWriteCopyLocalConfig("local.realm") + val partitionValue = TestHelper.randomPartitionValue() + val syncConfig = createSyncConfig( + user = user, + name = "sync1.realm", + partitionValue = partitionValue, + schema = setOf(SyncObjectWithAllTypes::class) + ) + Realm.open(syncConfig).use { syncRealm -> + // Write local data + syncRealm.writeBlocking { + copyToRealm( + SyncObjectWithAllTypes().apply { + stringField = "local object" + } + ) + } + // Copy to partition-based Realm + syncRealm.writeCopyTo(localConfig) + } + // Open Local Realm and check that data can read. + Realm.open(localConfig).use { localRealm: Realm -> + assertEquals(1, localRealm.query().count().find()) + assertEquals("local object", localRealm.query().first().find()!!.stringField) + } + } + + @Test + fun writeCopyTo_flexibleSyncToLocal() = runBlocking { + val flexApp = TestApp(appName = io.realm.kotlin.test.mongodb.TEST_APP_FLEX) + val (email1, password1) = randomEmail() to "password1234" + val user = flexApp.createUserAndLogIn(email1, password1) + val localConfig = createWriteCopyLocalConfig("local.realm") + val syncConfig = createSyncConfig( + user = user, + name = "sync.realm", + partitionValue = partitionValue, + schema = setOf(FlexParentObject::class, FlexChildObject::class, FlexEmbeddedObject::class) + ) + Realm.open(syncConfig).use { flexSyncRealm: Realm -> + flexSyncRealm.writeBlocking { + copyToRealm( + FlexParentObject().apply { + name = "local object" + } + ) + } + // Copy to local Realm + flexSyncRealm.writeCopyTo(localConfig) + } + // Open Local Realm and check that data can read. + Realm.open(localConfig).use { localRealm: Realm -> + assertEquals(1, localRealm.query().count().find()) + assertEquals("local object", localRealm.query().first().find()!!.name) + } + } + + @Test + fun writeCopyTo_partitionBasedToDifferentPartitionKey() = runBlocking { + val (email1, password1) = randomEmail() to "password1234" + val (email2, password2) = randomEmail() to "password1234" + val user1 = app.createUserAndLogIn(email1, password1) + val user2 = app.createUserAndLogIn(email2, password2) + val syncConfig1 = createSyncConfig( + user = user1, + name = "sync1.realm", + partitionValue = TestHelper.randomPartitionValue(), + schema = setOf(SyncObjectWithAllTypes::class) + ) + val syncConfig2 = createSyncConfig( + user = user2, + name = "sync2.realm", + partitionValue = TestHelper.randomPartitionValue(), + schema = setOf(SyncObjectWithAllTypes::class) + ) + Realm.open(syncConfig1).use { syncRealm1 -> + syncRealm1.writeBlocking { + copyToRealm( + SyncObjectWithAllTypes().apply { + stringField = "local object" + } + ) + } + // Copy to partition-based Realm + syncRealm1.syncSession.uploadAllLocalChanges(30.seconds) + // Work-around for https://github.com/realm/realm-core/issues/4865 + // Calling syncRealm1.syncSession.downloadAllServerChanges doesn't seem to + // fix it in all cases + delay(1000) + syncRealm1.writeCopyTo(syncConfig2) + } + // Open Sync Realm and ensure that data can be used and uploaded + Realm.open(syncConfig2).use { syncRealm2: Realm -> + val result = syncRealm2.query().find() + assertEquals(1, result.size) + assertEquals("local object", result.first().stringField) + syncRealm2.syncSession.uploadAllLocalChanges(30.seconds) + } + } + + @Test + fun writeCopyTo_partitionBasedToSamePartitionKey() = runBlocking { + val (email1, password1) = randomEmail() to "password1234" + val (email2, password2) = randomEmail() to "password1234" + val user1 = app.createUserAndLogIn(email1, password1) + val user2 = app.createUserAndLogIn(email2, password2) + val partitionValue = TestHelper.randomPartitionValue() + val syncConfig1 = createSyncConfig( + user = user1, + name = "sync1.realm", + partitionValue = partitionValue, + schema = setOf(SyncObjectWithAllTypes::class) + ) + val syncConfig2 = createSyncConfig( + user = user2, + name = "sync2.realm", + partitionValue = partitionValue, + schema = setOf(SyncObjectWithAllTypes::class) + ) + Realm.open(syncConfig1).use { syncRealm1 -> + // Write local data + syncRealm1.writeBlocking { + copyToRealm( + SyncObjectWithAllTypes().apply { + stringField = "local object" + } + ) + } + // Copy to partition-based Realm + syncRealm1.syncSession.uploadAllLocalChanges(30.seconds) + // Work-around for https://github.com/realm/realm-core/issues/4865 + // Calling syncRealm1.syncSession.downloadAllServerChanges doesn't seem to + // fix it in all cases + delay(1000) + syncRealm1.writeCopyTo(syncConfig2) + } + // Open Sync Realm and ensure that data can be used and uploaded + Realm.open(syncConfig2).use { syncRealm2: Realm -> + val result = syncRealm2.query().find() + assertEquals(1, result.size) + assertEquals("local object", result.first().stringField) + syncRealm2.syncSession.uploadAllLocalChanges(30.seconds) + } + } + + @Test + fun writeCopyTo_dataNotUploaded_throws() = runBlocking { + val (email1, password1) = randomEmail() to "password1234" + val user1 = app.createUserAndLogIn(email1, password1) + val syncConfigA = createSyncConfig( + user = user1, + name = "a.realm", + partitionValue = TestHelper.randomPartitionValue(), + schema = setOf(SyncObjectWithAllTypes::class) + ) + val syncConfigB = createSyncConfig( + user = user1, + name = "b.realm", + partitionValue = TestHelper.randomPartitionValue(), + schema = setOf(SyncObjectWithAllTypes::class) + ) + Realm.open(syncConfigA).use { realm -> + realm.syncSession.pause() + realm.writeBlocking { + copyToRealm(SyncObjectWithAllTypes()) + } + assertFailsWith { + realm.writeCopyTo(syncConfigB) + } + } + } + // @Test // fun initialVersion() { // assertEquals(INITIAL_VERSION, realm.version()) @@ -867,7 +1187,7 @@ class SyncedRealmTests { encryptionKey: ByteArray? = null, log: LogConfiguration? = null, errorHandler: ErrorHandler? = null, - schema: Set> = setOf(ParentPk::class, ChildPk::class), + schema: Set> = setOf(ParentPk::class, ChildPk::class), ): SyncConfiguration = SyncConfiguration.Builder( schema = schema, user = user, @@ -877,4 +1197,21 @@ class SyncedRealmTests { if (errorHandler != null) builder.errorHandler(errorHandler) if (log != null) builder.log(log.level, log.loggers) }.build() + + @Suppress("LongParameterList") + private fun createFlexibleSyncConfig( + user: User, + name: String = DEFAULT_NAME, + encryptionKey: ByteArray? = null, + log: LogConfiguration? = null, + errorHandler: ErrorHandler? = null, + schema: Set> = setOf(SyncObjectWithAllTypes::class), + ): SyncConfiguration = SyncConfiguration.Builder( + user = user, + schema = schema + ).name(name).also { builder -> + if (encryptionKey != null) builder.encryptionKey(encryptionKey) + if (errorHandler != null) builder.errorHandler(errorHandler) + if (log != null) builder.log(log.level, log.loggers) + }.build() } diff --git a/test/sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/BinaryObject.kt b/test/sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/BinaryObject.kt new file mode 100644 index 0000000000..815289d30d --- /dev/null +++ b/test/sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/BinaryObject.kt @@ -0,0 +1,28 @@ +/* + * Copyright 2021 Realm Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.realm.kotlin.entities.sync + +import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.annotations.PrimaryKey +import kotlin.random.Random + +// const val MAX_BINARY_SIZE = 0xFFFFF8 - 8 /*array header size*/ + +class BinaryObject : RealmObject { + @PrimaryKey var _id: String = Random.nextLong().toString() + var binary: ByteArray = Random.nextBytes(9999999) +} diff --git a/test/sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/SyncObjectWithAllTypes.kt b/test/sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/SyncObjectWithAllTypes.kt index ca7a4173cb..957f75b6de 100644 --- a/test/sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/SyncObjectWithAllTypes.kt +++ b/test/sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/SyncObjectWithAllTypes.kt @@ -22,6 +22,7 @@ import io.realm.kotlin.types.ObjectId import io.realm.kotlin.types.RealmInstant import io.realm.kotlin.types.RealmList import io.realm.kotlin.types.RealmObject +import io.realm.kotlin.types.RealmUUID import io.realm.kotlin.types.annotations.PrimaryKey import kotlin.random.Random @@ -44,6 +45,8 @@ class SyncObjectWithAllTypes : RealmObject { var floatField: Float = 0.0.toFloat() var realmInstantField: RealmInstant = RealmInstant.MIN var objectIdField: ObjectId = ObjectId.create() + var realmUUIDField: RealmUUID = RealmUUID.random() + var binaryField: ByteArray = byteArrayOf(42) var objectField: SyncObjectWithAllTypes? = null // Nullable types @@ -58,6 +61,8 @@ class SyncObjectWithAllTypes : RealmObject { var floatNullableField: Float? = null var realmInstantNullableField: RealmInstant? = null var objectIdNullableField: ObjectId? = null + var realmUUIDNullableField: RealmUUID? = null + var binaryNullableField: ByteArray? = null var objectNullableField: SyncObjectWithAllTypes? = null // RealmLists @@ -72,6 +77,8 @@ class SyncObjectWithAllTypes : RealmObject { var floatRealmList: RealmList = realmListOf(0.0.toFloat()) var realmInstantRealmList: RealmList = realmListOf(RealmInstant.MIN) var objectIdRealmList: RealmList = realmListOf(ObjectId.create()) + var realmUUIDRealmList: RealmList = realmListOf(RealmUUID.random()) + var binaryRealmList: RealmList = realmListOf(byteArrayOf(42)) var objectRealmList: RealmList = realmListOf() // Nullable RealmLists of primitive values, not currently supported by Sync @@ -230,6 +237,45 @@ class SyncObjectWithAllTypes : RealmObject { }, ) } + RealmStorageType.UUID -> { + val uuid1 = RealmUUID.random() + val uuid2 = RealmUUID.random() + val uuid3 = RealmUUID.random() + Pair( + { obj: SyncObjectWithAllTypes -> + obj.realmUUIDField = uuid1 + obj.realmUUIDNullableField = uuid1 + obj.realmUUIDRealmList = realmListOf(uuid2, uuid3) + }, + { obj: SyncObjectWithAllTypes -> + assertEquals(uuid1, obj.realmUUIDField) + assertEquals(uuid1, obj.realmUUIDNullableField) + assertEquals(uuid2, obj.realmUUIDRealmList[0]) + assertEquals(uuid3, obj.realmUUIDRealmList[1]) + }, + ) + } + RealmStorageType.BINARY -> { + Pair( + { obj: SyncObjectWithAllTypes -> + obj.binaryField = byteArrayOf(22) + obj.binaryNullableField = byteArrayOf(22) + obj.binaryRealmList = + realmListOf( + byteArrayOf(22), + byteArrayOf(44, 66), + byteArrayOf(11, 33) + ) + }, + { obj: SyncObjectWithAllTypes -> + assertContentEquals(byteArrayOf(22), obj.binaryField) + assertContentEquals(byteArrayOf(22), obj.binaryNullableField) + assertContentEquals(byteArrayOf(22), obj.binaryRealmList[0]) + assertContentEquals(byteArrayOf(44, 66), obj.binaryRealmList[1]) + assertContentEquals(byteArrayOf(11, 33), obj.binaryRealmList[2]) + }, + ) + } else -> TODO("Missing support for type: $type") } } @@ -241,6 +287,15 @@ class SyncObjectWithAllTypes : RealmObject { } } + private fun assertContentEquals(value: ByteArray?, other: ByteArray?) { + value?.forEachIndexed { index, byte -> + val actual = other?.get(index) + if (byte != actual) { + throw IllegalStateException("Values do not match: '$value' vs. '$other'") + } + } + } + /** * Create an object with sample data for all supported Core field types. */ diff --git a/test/sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/flx/FlexEmbeddedObject.kt b/test/sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/flx/FlexEmbeddedObject.kt new file mode 100644 index 0000000000..56207defee --- /dev/null +++ b/test/sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/flx/FlexEmbeddedObject.kt @@ -0,0 +1,26 @@ +/* + * Copyright 2022 Realm Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.realm.kotlin.entities.sync.flx + +import io.realm.kotlin.types.EmbeddedRealmObject + +/** + * Embedded Object used when testing Flexible Sync. + */ +class FlexEmbeddedObject : EmbeddedRealmObject { + var embeddedName: String = "" +} diff --git a/test/sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/flx/FlexParentObject.kt b/test/sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/flx/FlexParentObject.kt index c152656575..e1c7de7640 100644 --- a/test/sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/flx/FlexParentObject.kt +++ b/test/sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/flx/FlexParentObject.kt @@ -32,4 +32,6 @@ class FlexParentObject() : RealmObject { var section: Int = 0 var name: String = "" var age: Int = 42 + var child: FlexChildObject? = null + var embedded: FlexEmbeddedObject? = null } diff --git a/test/sync/src/commonMain/kotlin/io/realm/kotlin/test/mongodb/util/AdminApi.kt b/test/sync/src/commonMain/kotlin/io/realm/kotlin/test/mongodb/util/AdminApi.kt index 3ac3266ad7..f4f0e715f3 100644 --- a/test/sync/src/commonMain/kotlin/io/realm/kotlin/test/mongodb/util/AdminApi.kt +++ b/test/sync/src/commonMain/kotlin/io/realm/kotlin/test/mongodb/util/AdminApi.kt @@ -87,6 +87,12 @@ interface AdminApi { */ suspend fun triggerClientReset(userId: String) + /** + * Changes the permissions for sync. Receives a lambda block which with your test logic. + * It will safely revert to the original permissions even when an exception was thrown. + */ + suspend fun changeSyncPermissions(permissions: SyncPermissions, block: () -> Unit) + /** * Set whether or not automatic confirmation is enabled. */ @@ -120,6 +126,11 @@ interface AdminApi { fun closeClient() } +data class SyncPermissions( + val read: Boolean, + val write: Boolean +) + open class AdminApiImpl internal constructor( baseUrl: String, private val appName: String, @@ -127,7 +138,8 @@ open class AdminApiImpl internal constructor( override val dispatcher: CoroutineDispatcher ) : AdminApi { private val url = baseUrl + ADMIN_PATH - private val MDB_DATABASE_NAME: String = "test_data" // as defined in realm-kotlin/tools/sync_test_server/app_template/config.json + private val MDB_DATABASE_NAME: String = + "test_data" // as defined in realm-kotlin/tools/sync_test_server/app_template/config.json private lateinit var client: HttpClient private lateinit var groupId: String private lateinit var appId: String @@ -187,7 +199,7 @@ open class AdminApiImpl internal constructor( // Get app id appId = client.typedRequest(Get, "$url/groups/$groupId/apps") - .firstOrNull { it.jsonObject["client_app_id"]?.jsonPrimitive?.content == appName }?.jsonObject?.get( + .firstOrNull { it.jsonObject["client_app_id"]?.jsonPrimitive?.content!!.startsWith(appName) }?.jsonObject?.get( "_id" )?.jsonPrimitive?.content ?: error("App $appName not found") @@ -241,10 +253,32 @@ open class AdminApiImpl internal constructor( it.first().jsonObject["_id"]!!.jsonPrimitive.content } - private suspend fun controlSync(serviceId: String, enabled: Boolean) { + private suspend fun controlSync( + serviceId: String, + enabled: Boolean, + permissions: SyncPermissions? = null + ) { val url = "$url/groups/$groupId/apps/$appId/services/$serviceId/config" - val syncConfigData = JsonObject(mapOf("state" to JsonPrimitive(if (enabled) "enabled" else "disabled"))) - val configObj = JsonObject(mapOf("sync" to syncConfigData)) + val syncEnabled = if (enabled) "enabled" else "disabled" + val jsonPartition = permissions?.let { + val permissionList = JsonObject( + mapOf( + "read" to JsonPrimitive(permissions.read), + "write" to JsonPrimitive(permissions.read) + ) + ) + JsonObject(mapOf("permissions" to permissionList, "key" to JsonPrimitive("realm_id"))) + } + + // Add permissions if present, otherwise just change state + val content = jsonPartition?.let { + mapOf( + "state" to JsonPrimitive(syncEnabled), + "partition" to jsonPartition + ) + } ?: mapOf("state" to JsonPrimitive(syncEnabled)) + + val configObj = JsonObject(mapOf("sync" to JsonObject(content))) sendPatchRequest(url, configObj) } @@ -268,6 +302,21 @@ open class AdminApiImpl internal constructor( } } + override suspend fun changeSyncPermissions(permissions: SyncPermissions, block: () -> Unit) { + withContext(dispatcher) { + val backingDbServiceId = getBackingDBServiceId() + + // Execute test logic + try { + controlSync(backingDbServiceId, true, permissions) + block.invoke() + } finally { + // Restore original permissions + controlSync(backingDbServiceId, true, SyncPermissions(read = true, write = true)) + } + } + } + override suspend fun getAuthConfigData(): String { return withContext(dispatcher) { val providerId: String = getLocalUserPassProviderId() @@ -337,7 +386,9 @@ open class AdminApiImpl internal constructor( arr.firstOrNull { el: JsonElement -> el.jsonObject["name"]!!.jsonPrimitive.content == "local-userpass" }?.let { el: JsonElement -> - el.jsonObject["_id"]?.jsonPrimitive?.content ?: throw IllegalStateException("Could not find '_id': $arr") + el.jsonObject["_id"]?.jsonPrimitive?.content ?: throw IllegalStateException( + "Could not find '_id': $arr" + ) } ?: throw IllegalStateException("Could not find local-userpass provider: $arr") } } @@ -388,7 +439,8 @@ open class AdminApiImpl internal constructor( collection: String, query: String ): JsonObject { - val url = "$COMMAND_SERVER_BASE_URL/delete-document?db=$dbName&collection=$collection&query=$query" + val url = + "$COMMAND_SERVER_BASE_URL/delete-document?db=$dbName&collection=$collection&query=$query" return client.typedRequest(Get, url) } @@ -398,7 +450,8 @@ open class AdminApiImpl internal constructor( collection: String, oid: String ): JsonObject { - val url = "$COMMAND_SERVER_BASE_URL/query-document-by-id?db=$dbName&collection=$collection&oid=$oid" + val url = + "$COMMAND_SERVER_BASE_URL/query-document-by-id?db=$dbName&collection=$collection&oid=$oid" return client.typedRequest(Get, url) } diff --git a/test/sync/src/commonTest/kotlin/io/realm/kotlin.test/Utils.kt b/test/sync/src/commonTest/kotlin/io/realm/kotlin.test/Utils.kt new file mode 100644 index 0000000000..f4bb8c94c0 --- /dev/null +++ b/test/sync/src/commonTest/kotlin/io/realm/kotlin.test/Utils.kt @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Realm Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.realm.kotlin.test + +import kotlin.reflect.KClass +import kotlin.test.assertFailsWith + +// NOTE: Copy from :base:commonTest. It is unclear if there is an easy way to share test code like +// this between :base and :sync + +/** + * Assert that a statement fails with a specific Exception type AND message. The message match is + * fuzzy, i.e. we only check that the provided message is contained within the whole exception + * message. The match is case sensitive. + */ +fun assertFailsWithMessage(exceptionClass: KClass, exceptionMessage: String, block: () -> Unit): T { + val exception: T = assertFailsWith(exceptionClass, null, block) + if (exception.message?.contains(exceptionMessage, ignoreCase = false) != true) { + throw AssertionError( + """ + The exception message did not match. + + Expected: + $exceptionMessage + + Actual: + ${exception.message} + + """.trimIndent() + ) + } + return exception +} + +inline fun assertFailsWithMessage(exceptionMessage: String, noinline block: () -> Unit): T = + assertFailsWithMessage(T::class, exceptionMessage, block) diff --git a/tools/sync_test_server/Dockerfile b/tools/sync_test_server/Dockerfile index f50e4b5192..1f88e722e4 100644 --- a/tools/sync_test_server/Dockerfile +++ b/tools/sync_test_server/Dockerfile @@ -29,5 +29,5 @@ WORKDIR "/tmp" COPY mongodb-realm-command-server.js /tmp/ RUN npm install winston@2.4.0 temp httpdispatcher@1.0.0 fs-extra moment is-port-available@0.1.5 mongodb@4.5 mongodb-query-parser@2.4.6 -# Run integration test server -CMD /tmp/mongodb-realm-command-server.js +# Run integration test server with the rest of the services found within docker +CMD /tmp/mongodb-realm-command-server.js 127.0.0.1 diff --git a/tools/sync_test_server/Dockerfile.local b/tools/sync_test_server/Dockerfile.local new file mode 100644 index 0000000000..52b9ea9d2c --- /dev/null +++ b/tools/sync_test_server/Dockerfile.local @@ -0,0 +1,33 @@ +FROM node:12 + +# This Docker image is only responsible for running the Integration Command Server which can be +# used to instrument other parts of the Integration tests. +# +# It exposes a webserver on port 8888. + +# set timezone to Copenhagen (by default it's using UTC) to match Android's device time. +RUN cp /usr/share/zoneinfo/Europe/Copenhagen /etc/localtime +RUN echo "Europe/Copenhagen" > /etc/timezone + +# Install netstat (used for debugging) +# Fix https://superuser.com/questions/1420231/how-to-solve-404-error-in-aws-apg-get-for-debian-jessie-fetch +RUN rm etc/apt/sources.list +RUN echo "deb http://archive.debian.org/debian/ jessie main" >> etc/apt/sources.list +RUN echo "deb-src http://archive.debian.org/debian/ jessie main" >> etc/apt/sources.list +RUN echo "deb http://security.debian.org jessie/updates main" >> etc/apt/sources.list +RUN echo "deb-src http://security.debian.org jessie/updates main" >> etc/apt/sources.list + +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + net-tools \ + psmisc \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Copy webserver script and install dependencies +WORKDIR "/tmp" +COPY mongodb-realm-command-server.js /tmp/ +RUN npm install winston@2.4.0 temp httpdispatcher@1.0.0 fs-extra moment is-port-available@0.1.5 mongodb@4.5 mongodb-query-parser@2.4.6 + +# Run integration test server with the rest of the services found outside docker +CMD /tmp/mongodb-realm-command-server.js host.docker.internal diff --git a/tools/sync_test_server/app_template/services/BackingDB/rules/test_data.FlexParentObject.json b/tools/sync_test_server/app_template/services/BackingDB/rules/test_data.FlexParentObject.json index 4db1f9f685..b824f77430 100644 --- a/tools/sync_test_server/app_template/services/BackingDB/rules/test_data.FlexParentObject.json +++ b/tools/sync_test_server/app_template/services/BackingDB/rules/test_data.FlexParentObject.json @@ -37,6 +37,18 @@ }, "age": { "bsonType": "int" + }, + "embedded": { + "title": "FlexEmbeddedObject", + "bsonType": "object", + "required": [ + "embeddedName" + ], + "properties": { + "embeddedName": { + "bsonType": "string" + } + } } }, "required": [ diff --git a/tools/sync_test_server/bind_android_ports.sh b/tools/sync_test_server/bind_android_ports.sh new file mode 100755 index 0000000000..df86e6d040 --- /dev/null +++ b/tools/sync_test_server/bind_android_ports.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# This scripts tries to bind the android emulator ports to point the local development server. + +adb reverse tcp:9443 tcp:9443 && \ +adb reverse tcp:9080 tcp:9080 && \ +adb reverse tcp:9090 tcp:9090 && \ +adb reverse tcp:8888 tcp:8888 && \ +echo "Done" || { echo "Failed to reverse android emulator ports." ;} diff --git a/tools/sync_test_server/mongodb-realm-command-server.js b/tools/sync_test_server/mongodb-realm-command-server.js index 76e7440342..96244bd680 100755 --- a/tools/sync_test_server/mongodb-realm-command-server.js +++ b/tools/sync_test_server/mongodb-realm-command-server.js @@ -15,8 +15,12 @@ var http = require('http'); var url = require('url'); const fs = require('fs'); const { MongoClient, ObjectID } = require("mongodb"); + +const BAAS_HOST = process.argv[2]; +winston.info(`BAAS host: ${BAAS_HOST}`) + const mdb_uri = -"mongodb://localhost:26000/?readPreference=primary&directConnection=true&ssl=false"; +`mongodb://${BAAS_HOST}:26000/?readPreference=primary&directConnection=true&ssl=false`; const parser = require('mongodb-query-parser'); const isPortAvailable = require('is-port-available'); @@ -45,7 +49,13 @@ function handleForwardPatchRequest(clientReq, clientResp) { // Construct the intended request const forwardUrl = url.parse(clientReq.url, true).query["url"]; - var urlParts = url.parse(forwardUrl, false); + + // If pointing to a localhost, replace target by the actual local BAAS server + // depending if the services are host inside or outside docker. + + // host.docker.internal -> external to docker + // 127.0.0.1 -> internal to docker + var urlParts = url.parse(forwardUrl.replace("127.0.0.1", BAAS_HOST), false); var options = { hostname: urlParts.hostname, diff --git a/tools/sync_test_server/start_local_server.sh b/tools/sync_test_server/start_local_server.sh new file mode 100755 index 0000000000..262b330363 --- /dev/null +++ b/tools/sync_test_server/start_local_server.sh @@ -0,0 +1,197 @@ +#!/usr/bin/env bash +set -e + +# This script will download and install the BAAS server locally instead of using a docker image. +# +# The install location is ~/.realm_baas +# +# It requires the following tools installed in your system. +# * node +# * yarn +# * jq +# * realm-cli@1.3.4 +# * artifactory credentials. See https://wiki.corp.mongodb.com/display/BUILD/How+to+configure+npm+to+use+Artifactory +# * machine hostname defined in /etc/hosts. See https://wiki.corp.mongodb.com/display/MMS/Cloud+Developer+Setup#CloudDeveloperSetup-SensibleHostnameForYourMac + +NC='\033[0m' +RED='\033[0;31m' +YELLOW='\033[1;33m' + +BAAS_INSTALL_PATH="$HOME/.realm_baas" +SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +function echo_step () { + echo -e "${RED}----> $1${NC}" +} + +function check_dependencies () { + if ! realm-cli --version 2>&1 | grep -q "1.3.4"; then + echo "Error: realm-cli@1.3.4 not found. Install using 'npm install -g mongodb-realm-cli@1.3.4'" && exit 1 + fi + if [ -z ${AWS_ACCESS_KEY_ID} ]; then + echo "Error: AWS_ACCESS_KEY_ID not defined" && exit 1 + fi + if [ -z ${AWS_SECRET_ACCESS_KEY} ]; then + echo "Error: AWS_SECRET_ACCESS_KEY not defined" && exit 1 + fi + if ! which -s node; then + echo "Error: NodeJS not found" && exit 1 + fi + if ! which -s yarn; then + echo "Error: Yarn not found" && exit 1 + fi + if [[ ! -e ~/.npmrc ]]; then + echo "Error: Artifactory credentials not configured" && exit 1 + fi + if ! ping -qo `hostname` >/dev/null 2>&1; then + echo "Error: Hostname `hostname` missing in /etc/hosts" && exit 1 + fi + if ! which -s yq; then + echo "Error: yq not found. Install using 'brew install yq'" && exit 1 + fi + echo "Ok" +} + +function bind_android_emulator_ports () { + $SCRIPTPATH/bind_android_ports.sh +} + +function install_baas_ui () { + REALM_BAAS_UI_GIT_HASH=$(grep REALM_BAAS_UI_GIT_HASH $SCRIPTPATH/../../dependencies.list | cut -d'=' -f2) + + mkdir -p $BAAS_INSTALL_PATH + + pushd $BAAS_INSTALL_PATH + + if [[ ! -d $BAAS_INSTALL_PATH/baas-ui/.git ]]; then + git clone git@github.com:10gen/baas-ui.git + fi + + pushd baas-ui + git checkout $REALM_BAAS_UI_GIT_HASH + yarn run build + popd + + popd +} + +function wait_for_mongod { + RETRY_COUNT=${2:-120} + WAIT_COUNTER=0 + until pgrep -F $BAAS_INSTALL_PATH/mongod.pid > /dev/null 2>&1; do + + WAIT_COUNTER=$(($WAIT_COUNTER + 1 )) + if [[ $WAIT_COUNTER = $RETRY_COUNT ]]; then + echo "Error: Timed out waiting for mongod to start" + exit 1 + fi + + sleep 5 + done +} + +function bind_baas_ui () { + pushd $BAAS_INSTALL_PATH + mkdir -p baas/static + ln -fs ../../baas-ui baas/static/app + popd +} + +function install_baas () { + REALM_BAAS_GIT_HASH=$(grep REALM_BAAS_GIT_HASH $SCRIPTPATH/../../dependencies.list | cut -d'=' -f2) + + EVERGREEN_DIR=$SCRIPTPATH/../../packages/external/core/evergreen + + # boot baas in bg + $EVERGREEN_DIR/install_baas.sh -w $BAAS_INSTALL_PATH -b $REALM_BAAS_GIT_HASH & + INSTALL_BAAS_PID=$! + + # We need to bind the UI after the baas server has been checked + + echo_step "Waiting for mongod to boot to bind ui" + wait_for_mongod + + echo_step "Binding baas ui" + bind_baas_ui + + # wait for service to come up + $EVERGREEN_DIR/wait_for_baas.sh "$BAAS_INSTALL_PATH/baas_server.pid" +} + +function boot_command_server () { + cd $SCRIPTPATH + docker build $SCRIPTPATH -f Dockerfile.local -t mongodb-realm-command-server + docker run --rm -i -t -d -p8888:8888 -v$APP_CONFIG_DIR:/apps --name mongodb-realm-command-server mongodb-realm-command-server +} + +function generate_app_configs () { + APP_CONFIG_DIR=`mktemp -d -t app_config` + $SCRIPTPATH/app_config_generator.sh $APP_CONFIG_DIR $SCRIPTPATH/app_template partition testapp1 testapp2 + $SCRIPTPATH/app_config_generator.sh $APP_CONFIG_DIR $SCRIPTPATH/app_template flex testapp3 +} + +function import_apps () { + app_dir=$1 + realm-cli login --config-path=/tmp/stitch-config --base-url=http://localhost:9090 --auth-provider=local-userpass --username=unique_user@domain.com --password=password -y + access_token=$(yq e ".access_token" /tmp/stitch-config) + group_id=$(curl --header "Authorization: Bearer $access_token" http://localhost:9090/api/admin/v3.0/auth/profile -s | jq '.roles[0].group_id' -r) + cd $app_dir + for app in *; do + echo "importing app: ${app}" + + manifest_file="config.json" + app_id_param="" + if [ -f "$app/secrets.json" ]; then + # create app by importing an empty skeleton with the same name + app_name=$(jq '.name' "$app/$manifest_file" -r) + temp_app="/tmp/stitch-apps/$app" + mkdir -p "$temp_app" && echo "{ \"name\": \"$app_name\" }" > "$temp_app/$manifest_file" + realm-cli import --config-path=/tmp/stitch-config --base-url=http://localhost:9090 --path="$temp_app" --project-id $group_id -y --strategy replace + + app_id=$(jq '.app_id' "$temp_app/$manifest_file" -r) + app_id_param="--app-id=$app_id" + + # import secrets into the created app + while read -r secret value; do + realm-cli secrets add --config-path=/tmp/stitch-config --base-url=http://localhost:9090 --app-id=$app_id --name="$secret" --value="$(echo $value | sed 's/\\n/\n/g')" + done < <(jq 'to_entries[] | [.key, .value] | @tsv' "$app/secrets.json" -r) + fi + + realm-cli import --config-path=/tmp/stitch-config --base-url=http://localhost:9090 --path="$app" $app_id_param --project-id $group_id -y --strategy replace + jq '.app_id' "$app/$manifest_file" -r > "$app/app_id" + done +} + +function cleanup () { + kill -9 $INSTALL_BAAS_PID + $SCRIPTPATH/stop_local_server.sh +} + +# terminate install_baas.sh and its processes +trap cleanup INT TERM ERR + +# Get the script dir which contains the Dockerfile + +echo_step "Checking dependencies" +check_dependencies + +echo_step "Try to bind android emulator ports" +bind_android_emulator_ports + +echo_step "Installing baas-ui in ${YELLOW}$BAAS_INSTALL_PATH" +install_baas_ui + +echo_step "Installing and booting BAAS in ${YELLOW}$BAAS_INSTALL_PATH" +install_baas + +echo_step "Generate configs" +generate_app_configs + +echo_step "Importing apps" +import_apps $APP_CONFIG_DIR + +echo_step "Building and booting command server" +boot_command_server + +echo_step "Template apps are generated in/served from ${YELLOW}$APP_CONFIG_DIR" +echo_step "Server available at http://localhost:9090/" diff --git a/tools/sync_test_server/start_server.sh b/tools/sync_test_server/start_server.sh index 14ce0e57ea..6ba9328d81 100755 --- a/tools/sync_test_server/start_server.sh +++ b/tools/sync_test_server/start_server.sh @@ -26,10 +26,7 @@ DOCKERFILE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" MONGODB_REALM_VERSION=$(grep MONGODB_REALM_SERVER $DOCKERFILE_DIR/../../dependencies.list | cut -d'=' -f2) -adb reverse tcp:9443 tcp:9443 && \ -adb reverse tcp:9080 tcp:9080 && \ -adb reverse tcp:9090 tcp:9090 && \ -adb reverse tcp:8888 tcp:8888 || { echo "Failed to reverse adb port." ; exit 1 ; } +$DOCKERFILE_DIR/bind_android_ports.sh # Make sure that Docker works correctly with Github Docker Registry by logging in docker login docker.pkg.github.com -u $GITHUB_DOCKER_USER -p $GITHUB_DOCKER_TOKEN diff --git a/tools/sync_test_server/stop_local_server.sh b/tools/sync_test_server/stop_local_server.sh new file mode 100755 index 0000000000..23119907bc --- /dev/null +++ b/tools/sync_test_server/stop_local_server.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +WORK_PATH="$HOME/.realm_baas" +BAAS_PID="" +MONGOD_PID="" +if [[ -f $WORK_PATH/baas_server.pid ]]; then + BAAS_PID="$(< "$WORK_PATH/baas_server.pid")" +fi + +if [[ -f $WORK_PATH/mongod.pid ]]; then + MONGOD_PID="$(< "$WORK_PATH/mongod.pid")" +fi + +if [[ -n "$BAAS_PID" ]]; then + echo "Stopping baas $BAAS_PID" + kill -9 "$BAAS_PID" + rm "$WORK_PATH/baas_server.pid" +fi + + +if [[ -n "$MONGOD_PID" ]]; then + echo "Killing mongod $MONGOD_PID" + kill -9 "$MONGOD_PID" + rm "$WORK_PATH/mongod.pid" +fi + +docker stop mongodb-realm-command-server -t0 \ No newline at end of file