Skip to content

Fix code generation when using receiver bindings and @AssistedFactory #491

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

Merged
merged 1 commit into from
May 11, 2025

Conversation

asapha
Copy link
Contributor

@asapha asapha commented May 11, 2025

The code generation would sometimes double the this expressions

public class InjectAssistedFactoryComponent : AssistedFactoryComponent() {
  override val barFactory: AssistedBarFactory
    get() = object : AssistedBarFactory {
      override fun build(num: Int, name: String): FactoryAssistedBar = FactoryAssistedBar(
        num = num,

        // compilation failure here
        foo = this@InjectAssistedFactoryComponent.this@InjectAssistedFactoryComponent.provideFoo().bind,

        name = name,
        provided = this@InjectAssistedFactoryComponent.name
      )
    }

Continuation for #487

We'd get
foo = [email protected]@InjectAssistedFactoryComponent.provideFoo().bind

instead of
foo = [email protected]().bind

See evant#487 (comment)
@evant evant merged commit 8bb648e into evant:main May 11, 2025
2 checks passed
@evant
Copy link
Owner

evant commented May 11, 2025

thanks!

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

Successfully merging this pull request may close these issues.

2 participants