Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect generation for private set properties #57

Closed
mksmdvdff opened this issue Feb 7, 2024 · 4 comments
Closed

Incorrect generation for private set properties #57

mksmdvdff opened this issue Feb 7, 2024 · 4 comments

Comments

@mksmdvdff
Copy link

mksmdvdff commented Feb 7, 2024

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

@FilipDolnik
Copy link
Member

FilipDolnik commented Feb 7, 2024

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)
        }
    }
}

@mksmdvdff
Copy link
Author

mksmdvdff commented Feb 7, 2024

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?

@FilipDolnik
Copy link
Member

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.

@FilipDolnik
Copy link
Member

Fixed in 0.6.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants