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

K2 factory generation: support generic type parameter bounds #1122

Open
RBusarow opened this issue Feb 20, 2025 · 0 comments
Open

K2 factory generation: support generic type parameter bounds #1122

RBusarow opened this issue Feb 20, 2025 · 0 comments
Labels
bug Something isn't working K2

Comments

@RBusarow
Copy link
Collaborator

Given a type parameter of T: List<String>, we should see:

public final class InjectClass_Factory<T : kotlin.collections.List<kotlin.String>> public constructor(t: javax.inject.Provider<@kotlin.jvm.JvmSuppressWildcards T>) : dagger.internal.Factory<com.squareup.test.InjectClass<T>> {
    public companion object {
        @kotlin.jvm.JvmStatic public final fun <T : kotlin.collections.List<kotlin.String>> create(t: javax.inject.Provider<@kotlin.jvm.JvmSuppressWildcards T>): com.squareup.test.InjectClass_Factory<T> { /* compiled code */ }

        @kotlin.jvm.JvmStatic public final fun <T : kotlin.collections.List<kotlin.String>> newInstance(t: @kotlin.jvm.JvmSuppressWildcards T): com.squareup.test.InjectClass<T> { /* compiled code */ }
    }

    private final val t: javax.inject.Provider<@kotlin.jvm.JvmSuppressWildcards T> /* compiled code */

    public open fun get(): com.squareup.test.InjectClass<T> { /* compiled code */ }
}

but instead, in FIR we're creating:

public final class InjectClass_Factory public constructor(t: javax.inject.Provider<[Error type: Unknown type parameter 0. Please try recompiling module containing "[container not found]"]>) : dagger.internal.Factory<com.squareup.test.InjectClass> {
    public companion object {
        @kotlin.jvm.JvmStatic public final fun create(t: javax.inject.Provider<[Error type: Unknown type parameter 0. Please try recompiling module containing "[container not found]"]>): com.squareup.test.InjectClass_Factory { /* compiled code */ }

        @kotlin.jvm.JvmStatic public final fun newInstance(t: [Error type: Unknown type parameter 0. Please try recompiling module containing "[container not found]"]): com.squareup.test.InjectClass { /* compiled code */ }
    }
    public final val t: javax.inject.Provider<[Error type: Unknown type parameter 0. Please try recompiling module containing "[container not found]"]> /* compiled code */

    public final fun get(): com.squareup.test.InjectClass<[Error type: Unknown type parameter 0. Please try recompiling module containing "[container not found]"]> { /* compiled code */ }
}
@RBusarow RBusarow added bug Something isn't working K2 labels Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working K2
Projects
None yet
Development

No branches or pull requests

1 participant