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

Build Error When Enum Name Conflicts with KMP Library Name #114

Open
sobaya-0141 opened this issue Sep 19, 2024 · 1 comment
Open

Build Error When Enum Name Conflicts with KMP Library Name #114

sobaya-0141 opened this issue Sep 19, 2024 · 1 comment

Comments

@sobaya-0141
Copy link

The following template contains guiding questions that should help you provide as much helpful information as possible.

You don't have to follow the template, you can just write the bug report and check this template to see if the bug report answers all the relevant questions. Don't worry if you don't know some answers; we will help you find them if needed.

Questions:

What is the problem?

Build Error

When does the problem occur?

How do we reproduce the issue?

What is your SKIE Gradle configuration?

A build error occurs when the KMP library name and an enum constant name are the same.

Example:

kotlin {
    val xcfName = "hoge"  // This conflicts
    val xcf = XCFramework(xcfName)
    sourceSets.forEach {
        it.binaries.framework {
            baseName = xcfName
        }
    }
}
enum class Fuga {
    HOGE,  // This causes the build error
    SOBA,
}

What versions of SKIE, Kotlin, and Gradle do you use?

SKIE:0.8.4

@ykws
Copy link

ykws commented Sep 19, 2024

Additional Information: We encountered the following error:

error: enum case 'hoge' cannot be used as an instance member
        case .hoge: return hoge.__Fuga.hoge as hoge.__Fuga
                            ^~~~~~
                            Fuga.

We still have an error, even when using @ObjCName(swiftName = "hoge2") with sight changes.

error: static member 'hoge' cannot be used on instance of type '__Fuga'
        return hoge.Fuga._unconditionallyBridgeFromObjectiveC(self)
               ^~~~~~
               __Fuga.

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