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

Using a public property extensions with a @Composable backing delegate fails to link for iOS targets #2901

Closed
xxfast opened this issue Mar 20, 2023 · 2 comments
Assignees
Labels
bug Something isn't working compiler Compiler plugin related

Comments

@xxfast
Copy link

xxfast commented Mar 20, 2023

Describe the bug
I have property extensions with a @composable backing delegate that looks like this

val text: String @Composable get() = "Some text"

This works as expected for android/desktop, but fails to link for ios clients and throws this error

> Task :app:ui:linkPodDebugFrameworkIosSimulatorArm64

Showing All Messages
> Task :app:ios-compose:linkPodDebugFrameworkIosSimulatorArm64 FAILED
e: There is still an unbound symbol after generation of IR module <NyTimes>:

Unbound public symbol IrSimpleFunctionPublicSymbolImpl: io.github.xxfast.nytimes.ios.compose/text.<get-text>|8349765969627210272[0]

This could happen if there are two libraries, where one library was compiled against the different version of the other library than the one currently used in the project. Please check that the project configuration is correct and has consistent versions of dependencies.

Current work around is to keep these either private or internal

private val text: String @Composable get() = "Some text"
// or
private val text: String @Composable get() = "Some text"

Affected platforms
Select one of the platforms below:

  • iOS

Versions

  • Kotlin version*: 1.8.10
  • Compose Multiplatform version*: 1.3.1
  • OS version(s)*: iOS 16.2
  • OS architecture (x86 or arm64): arm64

To Reproduce
Steps and/or the code snippet to reproduce the behavior:

  1. Checkout xxfast/NYTimes-KMP@fc231fc
  2. Open app/ios/ios.xcworkspace and run

Expected behavior
@Composable backing delegates for iOS targets to behave the same as other platforms.

This is similar to #2903 so feel free to close this or that if it is the same underlying issue

@xxfast xxfast added bug Something isn't working submitted labels Mar 20, 2023
@xxfast xxfast changed the title Using property extensions with a @Composable backing delegate fails to compile for iOS targets Using a public property extensions with a @Composable backing delegate fails to compile for iOS targets Mar 21, 2023
@xxfast xxfast changed the title Using a public property extensions with a @Composable backing delegate fails to compile for iOS targets Using a public property extensions with a @Composable backing delegate fails to link for iOS targets Mar 21, 2023
@eymar eymar added compiler Compiler plugin related and removed submitted labels Mar 23, 2023
@eymar
Copy link
Member

eymar commented Apr 12, 2023

The fix is available with Compose Multiplatform 1.4.0 when used with kotlin 1.8.20

@okushnikov
Copy link
Collaborator

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

@JetBrains JetBrains locked and limited conversation to collaborators Dec 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working compiler Compiler plugin related
Projects
None yet
Development

No branches or pull requests

3 participants