From be539af2f1807cf0a2d06419720e7b2e909b2358 Mon Sep 17 00:00:00 2001 From: Tadeas Kriz Date: Tue, 21 May 2024 09:05:01 -0400 Subject: [PATCH] Fix SwiftUI observing's @_spi usage. --- .../phases/runtime/SwiftUIFlowObservingGenerator.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/SKIE/kotlin-compiler/core/src/commonMain/kotlin/co/touchlab/skie/phases/runtime/SwiftUIFlowObservingGenerator.kt b/SKIE/kotlin-compiler/core/src/commonMain/kotlin/co/touchlab/skie/phases/runtime/SwiftUIFlowObservingGenerator.kt index 7cd94b25..bbbe506e 100644 --- a/SKIE/kotlin-compiler/core/src/commonMain/kotlin/co/touchlab/skie/phases/runtime/SwiftUIFlowObservingGenerator.kt +++ b/SKIE/kotlin-compiler/core/src/commonMain/kotlin/co/touchlab/skie/phases/runtime/SwiftUIFlowObservingGenerator.kt @@ -129,6 +129,16 @@ object SwiftUIFlowObservingGenerator { var initialValue: Element { get } } + extension SkieSwiftFlowWithInitialValue { + var flow: Flow { + Swift.fatalError("SkieSwiftFlowWithInitialValue has to be conformed to with @_spi(SKIE) enabled and this property implemented") + } + + var initialValue: Element { + Swift.fatalError("SkieSwiftFlowWithInitialValue has to be conformed to with @_spi(SKIE) enabled and this property implemented") + } + } + internal struct SkieSwiftFlowWithInitialValueImpl: SkieSwiftFlowWithInitialValue { let flow: Flow let initialValue: Flow.Element @@ -148,7 +158,7 @@ object SwiftUIFlowObservingGenerator { extension SkieSwiftMutableStateFlow: SkieSwiftFlowWithInitialValue { @_spi(SKIE) - public var flow: some SkieSwiftMutableStateFlow { + public var flow: SkieSwiftMutableStateFlow { self }