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

[Bug] Overload resolution ambiguity in Compose Resources Gradle plugin #4237

Closed
ChristianKatzmann opened this issue Feb 5, 2024 · 2 comments
Assignees
Labels
bug Something isn't working submitted

Comments

@ChristianKatzmann
Copy link

Describe the bug
If we define two resources with different type but same name, the build fails with an Overload resolution ambiguity as the initializer functions introduced in #4205 does not contain the type in its name.

e: ui/build/generated/compose/resourceGenerator/kotlin/ui/generated/resources/Res.kt:30:55 Overload resolution ambiguity:
private fun get_powered_by(): DrawableResource defined in ui.generated.resources in file Res.kt
private fun get_powered_by(): StringResource defined in ui.generated.resources in file Res.kt
e: ui/build/generated/compose/resourceGenerator/kotlin/ui/generated/resources/Res.kt:84:53 Overload resolution ambiguity:
private fun get_powered_by(): DrawableResource defined in package.ui.generated.resources in file Res.kt
private fun get_powered_by(): StringResource defined in ui.generated.resources in file Res.kt
e: ui/build/generated/compose/resourceGenerator/kotlin/ui/generated/resources/Res.kt:110:1 Conflicting overloads: private fun get_powered_by(): DrawableResource defined in ui.generated.resources in file Res.kt, private fun get_powered_by(): StringResource defined in ui.generated.resources in file Res.kt
e: ui/build/generated/compose/resourceGenerator/kotlin/ui/generated/resources/Res.kt:298:1 Conflicting overloads: private fun get_powered_by(): DrawableResource defined in ui.generated.resources in file Res.kt, private fun get_powered_by(): StringResource defined in ui.generated.resources in file Res.kt

This log is from my own project, redacted.

Affected platforms
All

Versions

  • Kotlin version*: 1.9.22
  • Compose Multiplatform version*: 1.6.0-dev1405
  • OS version(s)* (required for Desktop and iOS issues): macOS Sonoma 14.2.1
  • OS architecture (x86 or arm64): arm64
  • JDK (for desktop issues): Zulu 17

To Reproduce
Define two resources with different type but same name.

Expected behavior
The generated Res.kt file compiles.

@ChristianKatzmann ChristianKatzmann added bug Something isn't working submitted labels Feb 5, 2024
@ChristianKatzmann
Copy link
Author

I was able to reproduce the issue in ChristianKatzmann/compose-multiplatform@b63a963.

@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 submitted
Projects
None yet
Development

No branches or pull requests

3 participants