touchlab/SKIE

Incorrect generation for private set properties

Closed this issue · 4 comments

What is the problem?

Skie generates incorrect implementation for global property, and fails to build for iOS.
My 'linkPodDebugFrameworkIosSimulatorArm64' fails with:
build/skie/binaries/podDebugFramework/DEBUG/iosSimulatorArm64/swift/generated/Runtime/Runtime.LiveLiteralKt.swift:8:32: error: cannot assign to property: 'isLiveLiteralsEnabled' is a get-only property

Here is implementation from this file

public var isLiveLiteralsEnabled: Swift.Bool {
get {
return myApp.LiveLiteralKt.isLiveLiteralsEnabled
}
set(value) {
myApp.LiveLiteralKt.isLiveLiteralsEnabled = value
}
}

While LiveLiteral.kt (from Jetbrains Compose) looks like

@InternalComposeApi
@ComposeCompilerApi
var isLiveLiteralsEnabled: Boolean = false
private set

Kotlin version: 1.9.22
SKIE version: 0.6.1

Hi! I was able to reproduce this error, and it will likely be fixed in the next bug-fix release.

In the meantime, you can work around this problem by disabling the global wrapper for this property using the Gradle configuration:

skie {
    features {
        // Not sure if this is the right package name
        group("androidx.compose.runtime.internal.isLiveLiteralsEnabled") {
            FunctionInterop.FileScopeConversion.Enabled(false)
        }
    }
}

It works, but it must be "false" in last line. But anyway - thank you for so fast answer and help! Do I need to close this issue?

Oh, yeah, it should be "false". I was testing if it works and forgot to change it back :D I corrected the code in the previous comment.

No need to close this issue, I will close it after we have a proper fix.

Fixed in 0.6.2.