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

[KSP2] kotlin-inject doesn't link typealiases for functions to their function #458

Open
ZacSweers opened this issue Dec 25, 2024 · 2 comments

Comments

@ZacSweers
Copy link
Contributor

ZacSweers commented Dec 25, 2024

Repro from here: https://github.com/slackhq/circuit/blob/main/samples/kotlin-inject/src/main/kotlin/com/slack/circuit/sample/kotlininject/main.kt#L22

typealias KotlinInjectApp = @Composable () -> Unit

fun main() = application {
  val app = remember { AppComponent::class.create().kotlinInjectApp }

  Window(onCloseRequest = ::exitApplication, title = "Sample") { app() }
}

@Inject
@Composable
fun KotlinInjectApp(circuit: Circuit) {
  CircuitCompositionLocals(circuit) { CircuitContent(MyScreen("Circuit")) }
}

To test:

  • Checkout the repo
    • If this PR hasn't merged yet, checkout that branch
  • Set KSP2 to true in /samples/kotlin-inject/build.gradle.kts
  • Run ./gradlew :samples:kotlin-inject:kspKotlin

This works fine in KSP1, let me know if this is a KSP bug I should file upstream. This is on KSP 2.1.0-1.0.29.

@eygraber
Copy link
Contributor

@ZacSweers are you able to test your repro against #350?

@ZacSweers
Copy link
Contributor Author

I can give it another try once it's in snapshots 👍

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