From cfb885b33847b61117334f46d2d5cd6386eb0666 Mon Sep 17 00:00:00 2001 From: Gijs van Veen Date: Fri, 15 Nov 2024 10:52:57 +0100 Subject: [PATCH] Lint fix --- .../kotlin/dev/gitlive/firebase/firestore/Filter.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/Filter.kt b/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/Filter.kt index 640c24fdb..9cef926d6 100644 --- a/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/Filter.kt +++ b/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/Filter.kt @@ -48,7 +48,7 @@ public class FilterBuilder internal constructor() : EncodeSettings.Builder { override var encodeDefaults: Boolean get() = _encodeDefaults set(value) { - if (_encodeSettingsBuilder.isInitialized()) { + if (lazyEncodeSettingsBuilder.isInitialized()) { throw IllegalStateException("You should not change encode settings after they've been used. Call withEncoder again") } else { _encodeDefaults = value @@ -58,21 +58,21 @@ public class FilterBuilder internal constructor() : EncodeSettings.Builder { override var serializersModule: SerializersModule get() = _serializersModule set(value) { - if (_encodeSettingsBuilder.isInitialized()) { + if (lazyEncodeSettingsBuilder.isInitialized()) { throw IllegalStateException("You should not change encode settings after they've been used. Call withEncoder again") } else { _serializersModule = value } } - private val _encodeSettingsBuilder: Lazy Unit> = lazy { + private val lazyEncodeSettingsBuilder: Lazy Unit> = lazy { { copyFrom(this@FilterBuilder) } } @PublishedApi - internal val encodeSettingsBuilder: EncodeSettings.Builder.() -> Unit = _encodeSettingsBuilder.value + internal val encodeSettingsBuilder: EncodeSettings.Builder.() -> Unit = lazyEncodeSettingsBuilder.value public fun withEncoder(dsl: FilterBuilder.() -> Filter): Filter = FilterBuilder() .apply { copyFrom(this@FilterBuilder) }