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

Override a protected @Composable method leads to Compilation Failed on iOS target #4055

Closed
ssttkkl opened this issue Dec 21, 2023 · 3 comments
Assignees
Labels
bug Something isn't working compiler Compiler plugin related ios reproduced

Comments

@ssttkkl
Copy link

ssttkkl commented Dec 21, 2023

Describe the bug
Override a protected @Composable method leads to Compilation failed on iOS target.

Affected platforms

  • iOS

Versions

  • Kotlin version*: 1.9.21
  • Compose Multiplatform version*: 1.6.0-alpha01

To Reproduce

Just add this piece of code and run gradle task linkPodDebugFrameworkIosSimulatorArm64.

package io.ssttkkl.demo

import androidx.compose.material3.Text
import androidx.compose.runtime.Composable

abstract class AbstractGreeter {
    @Composable
    protected abstract fun Greeting()
}

class Greeter(val target: String) : AbstractGreeter() {
    @Composable
    override fun Greeting() {
        Text("Hello, $target! ")
    }
}

Got this error message:

e: Compilation failed: no implementation for FUN MISSING_DECLARATION name:Greeting visibility:public modality:FINAL <> () returnType:kotlin.Nothing
in io.ssttkkl.demo.AbstractGreeter

 * Source files: 
 * Compiler version: 1.9.21
 * Output kind: FRAMEWORK

Expected behavior
This code should be built successfully.

@ssttkkl ssttkkl added bug Something isn't working submitted labels Dec 21, 2023
@igordmn
Copy link
Collaborator

igordmn commented Dec 21, 2023

Reproduced on iOS. Isn't reproducible on desktop.

@igordmn igordmn added compiler Compiler plugin related ios reproduced and removed submitted labels Dec 21, 2023
shishkin-pavel added a commit to JetBrains/compose-multiplatform-core that referenced this issue Feb 7, 2024
shishkin-pavel added a commit to JetBrains/compose-multiplatform-core that referenced this issue Feb 7, 2024
JetBrains/compose-multiplatform#4055

protected composable functions were trying to be exported for calls from
ObjC, resulting in signature mismatches due to Composable functions
transformation
eymar pushed a commit to JetBrains/compose-multiplatform-core that referenced this issue Feb 14, 2024
JetBrains/compose-multiplatform#4055

protected composable functions were trying to be exported for calls from
ObjC, resulting in signature mismatches due to Composable functions
transformation
eymar pushed a commit to JetBrains/compose-multiplatform-core that referenced this issue Feb 14, 2024
JetBrains/compose-multiplatform#4055

protected composable functions were trying to be exported for calls from
ObjC, resulting in signature mismatches due to Composable functions
transformation
shishkin-pavel pushed a commit to JetBrains/compose-multiplatform-core that referenced this issue Mar 5, 2024
fix: prevent protected composable export to objc (#1065)

JetBrains/compose-multiplatform#4055

protected composable functions were trying to be exported for calls from
ObjC, resulting in signature mismatches due to Composable functions
transformation

Add HiddenFromObjC annotation to composable declarations

Add HiddenFromObjC to property getter and setter if necessary (#579)

Use FqName in HideFromObjCDeclarationsSet

Also: mark properties of CompositionLocal type as HiddenFromObjC
shishkin-pavel added a commit to JetBrains/compose-multiplatform-core that referenced this issue Mar 8, 2024
JetBrains/compose-multiplatform#4055

protected composable functions were trying to be exported for calls from
ObjC, resulting in signature mismatches due to Composable functions
transformation
@shishkin-pavel
Copy link
Collaborator

shishkin-pavel commented Mar 15, 2024

should be fixed since Compose Compiler 1.5.8.1 (Compose 1.6.0)

shishkin-pavel added a commit to JetBrains/compose-multiplatform-core that referenced this issue Mar 21, 2024
JetBrains/compose-multiplatform#4055

protected composable functions were trying to be exported for calls from
ObjC, resulting in signature mismatches due to Composable functions
transformation
shishkin-pavel pushed a commit to JetBrains/compose-multiplatform-core that referenced this issue Apr 4, 2024
fix: prevent protected composable export to objc (#1065)

JetBrains/compose-multiplatform#4055

protected composable functions were trying to be exported for calls from
ObjC, resulting in signature mismatches due to Composable functions
transformation

Add HiddenFromObjC annotation to composable declarations

Add HiddenFromObjC to property getter and setter if necessary (#579)

Use FqName in HideFromObjCDeclarationsSet

Also: mark properties of CompositionLocal type as HiddenFromObjC
shishkin-pavel pushed a commit to JetBrains/compose-multiplatform-core that referenced this issue Apr 10, 2024
objc export: review rename

objc export:review fixes/refactoring

review fixes

Change-Id: If1c308aa92881f5770f112dc9a78e017821f923e

TEMPORARY: gerrit review fixes

Change-Id: I828204b35cc37d2a9e504494a824b5753f7215fa

ktlint check fixes + isCompositionLocal simplification

fix: prevent protected composable export to objc (#1065)

JetBrains/compose-multiplatform#4055

protected composable functions were trying to be exported for calls from
ObjC, resulting in signature mismatches due to Composable functions
transformation

Add HiddenFromObjC annotation to composable declarations

Add HiddenFromObjC to property getter and setter if necessary (#579)

Use FqName in HideFromObjCDeclarationsSet

Also: mark properties of CompositionLocal type as HiddenFromObjC
@okushnikov
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler Compiler plugin related ios reproduced
Projects
None yet
Development

No branches or pull requests

5 participants